Skip to content

Instantly share code, notes, and snippets.

@bookercodes
Last active November 5, 2025 20:55
Show Gist options
  • Select an option

  • Save bookercodes/26c3b6e6374a6c9e6e8a1bdbadd83a04 to your computer and use it in GitHub Desktop.

Select an option

Save bookercodes/26c3b6e6374a6c9e6e8a1bdbadd83a04 to your computer and use it in GitHub Desktop.
const weatherTool = createTool({ });
const server = new MCPServer({
name: "my-mcp-server",
version: "1.0.0",
tools: { weatherTool },
});
const memory = new Memory({
options: {
lastMessages: 10,
semanticRecall: {
topK: 3,
messageRange: 2, // Include 2 messages before and after each match
},
},
});
const agent = new Agent({ memory });
const weatherTool = createTool({
inputSchema: z.object({
location: z.string(),
}),
outputSchema: z.object({
weather: z.string(),
}),
execute: async ({ ctx }) => {
return { weather: `Weather for ${ctx.location}` };
},
});
const agent = new Agent({ tools: { weatherTool } });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment