Skip to main content
Glama

Captain Data MCP API

introspect.ts1.07 kB
import { FastifyRequest, FastifyReply } from 'fastify'; import { TOOL_SCHEMAS } from "../../lib/schemas"; import { logError } from "../../middleware"; interface IntrospectQuery { v?: string; } export default async function handler(req: FastifyRequest<{ Querystring: IntrospectQuery }>, reply: FastifyReply) { try { const wantFull = req.query.v === "full"; const aliases = wantFull ? Object.keys(TOOL_SCHEMAS) : Object.keys(TOOL_SCHEMAS).slice(0, 5); const tools = aliases.map(a => { const schema = TOOL_SCHEMAS[a as keyof typeof TOOL_SCHEMAS]; return { type: "function", function: { name: a, description: schema.description, parameters: schema.parameters } }; }); return reply.send({ tools }); } catch (error) { logError('Failed to generate tool introspection', error, req, { endpoint: 'introspect' }); return reply.status(500).send({ code: 'introspect_error', message: 'Failed to generate tool introspection' }); } }

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/captaindatatech/captaindata-mcp'

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