Skip to main content
Glama

extract_schemas

Extracts API schemas from source code by auto-detecting format from file contents, supporting MCP, OpenAPI, GraphQL, tRPC, REST, gRPC, Python, Go, and SQL DDL.

Instructions

Extract API schemas from source code. Supports: MCP tools (Zod), OpenAPI/Swagger specs, GraphQL SDL, tRPC routers, REST endpoints (Express/Fastify), gRPC/Protobuf services, Python (FastAPI/Flask decorators), Go (Gin/Chi handlers), and SQL DDL (CREATE TABLE, CREATE TYPE). Auto-detects format from file contents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootDirYesRoot directory of server/API source code
includeNoGlob patterns to include (e.g., **/*.ts, **/*.py, **/*.go, **/*.proto, **/*.sql)
excludeNoGlob patterns to exclude
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It mentions auto-detection of format, which is helpful, but does not disclose limitations (e.g., behavior on large directories, handling of unsupported formats, or whether schemas are validated). This level of transparency is adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (one paragraph) and front-loaded with the main purpose. However, the list of supported formats could be better structured (e.g., bullet points) for readability. It is still efficient with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (many formats, no output schema), the description lacks explanation of the output format or sample usage. It does not clarify what the extracted schema looks like (e.g., JSON, YAML, or structured data). This leaves some gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for 3 parameters, each with descriptions. The description adds context about supported formats but does not enhance parameter semantics beyond what the schema provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Extract API schemas from source code.' It lists numerous supported formats (MCP tools, OpenAPI, GraphQL, tRPC, REST, gRPC, Python, Go, SQL DDL), making it distinct from sibling tools like extract_file (which extracts files) and compare (which compares schemas).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when source code contains API schemas but lacks explicit guidance on when to use this tool versus alternatives. It does not provide when-not-to-use conditions or mention sibling tools as alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Mnehmos/mnehmos.trace.mcp'

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