Last active
November 5, 2025 20:55
-
-
Save bookercodes/26c3b6e6374a6c9e6e8a1bdbadd83a04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const weatherTool = createTool({ }); | |
| const server = new MCPServer({ | |
| name: "my-mcp-server", | |
| version: "1.0.0", | |
| tools: { weatherTool }, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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