Skip to main content
Glama

extract_api_schema

Extract API schema from discovered endpoints to document and analyze web service interfaces for development workflows.

Instructions

Extract API schema from discovered endpoints

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to analyze
endpointNoSpecific endpoint to extract schema from

Implementation Reference

  • Registration of the 'extract_api_schema' tool in the apiDiscoveryTools array, including name, description, and input schema definition.
    { name: 'extract_api_schema', description: 'Extract API schema from discovered endpoints', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'URL to analyze', }, endpoint: { type: 'string', description: 'Specific endpoint to extract schema from', }, }, required: ['url'], }, },
  • Input schema definition for the 'extract_api_schema' tool.
    inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'URL to analyze', }, endpoint: { type: 'string', description: 'Specific endpoint to extract schema from', }, }, required: ['url'], },
  • Handler logic in handleAPIDiscoveryTool function that processes the tool call by extracting URL/endpoint params and delegating to APIScraper.extractAPISchema.
    case 'extract_api_schema': { const url = params.url as string; const endpoint = params.endpoint as string | undefined; const schema = await apiScraper.extractAPISchema(url, endpoint); return schema; }
  • Core implementation of API schema extraction in APIScraper class, which discovers endpoints and constructs a schema object.
    async extractAPISchema(url: string, _endpoint?: string): Promise<Record<string, unknown>> { // This is a simplified version. In production, would analyze actual API responses const result = await this.discoverAPIEndpoints(url); const schema: Record<string, unknown> = { baseUrl: result.baseUrl, endpoints: result.endpoints.map((e) => ({ method: e.method, path: e.path, parameters: e.parameters, })), }; return schema; }

Latest Blog Posts

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/code-alchemist01/development-tools-mcp-Server'

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