Skip to content

Move this tests to geocontext repository #1

@mborne

Description

@mborne

Context

This first tests have been written in a decidated repository but it is better to keep them in the MCP

Note

Finally found a solution for the beloved corporate proxy with undici :

import { createAgent, tool } from "langchain";
import * as z from "zod";

import { setGlobalDispatcher, ProxyAgent } from "undici";
const proxyAgent = new ProxyAgent(process.env.HTTP_PROXY);
setGlobalDispatcher(proxyAgent);

const getWeather = tool(
  (input) => `It's always sunny in ${input.city}!`,
  {
    name"get_weather",
    description"Get the weather for a given city",
    schemaz.object({
      cityz.string().describe("The city to get the weather for"),
    }),
  }
);

const agent = createAgent({
  model"claude-sonnet-4-6",
  tools[getWeather],
});

console.log(
  await agent.invoke({
    messages[{ role"user", content"What's the weather in Tokyo?" }],
  })
);

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions