Skip to main content
Glama

MCP Agent TypeScript Port

by waldzellai
index.ts1.08 kB
import { McpServer } from '../mcp/mcpServer'; import { ToolHandler } from './types'; import { echoTool } from './echo'; /** * Default set of tool handlers exposed by the server. */ export const defaultTools: ToolHandler[] = [echoTool]; /** * Register provided tools with an MCP server instance. */ export function registerTools(server: McpServer, tools: ToolHandler[] = defaultTools): void { for (const tool of tools) { server.registerTool(tool.name, { description: tool.description, inputSchema: tool.inputSchema, outputSchema: tool.outputSchema, handler: tool.handler }); } } /** * Convenience method to retrieve tool metadata without handlers. */ export function listTools(tools: ToolHandler[] = defaultTools): Record<string, unknown> { const result: Record<string, unknown> = {}; for (const tool of tools) { result[tool.name] = { description: tool.description, inputSchema: tool.inputSchema, outputSchema: tool.outputSchema }; } return result; } export * from './types'; export * from './echo';

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/waldzellai/mcp-agent-ts'

If you have feedback or need assistance with the MCP directory API, please join our Discord server