Skip to main content
Glama

code-api-surface

Extract HTTP routes, exported symbols, and middleware from source code via static analysis. Supports Express, FastAPI, Flask, Django, Spring Boot, ASP.NET, Rails, Gin. Returns JSON.

Instructions

Analyzes a code snippet and returns its API surface: HTTP routes (method + path), exported symbols, and middleware. Supports Express, FastAPI, Flask, Django, Spring Boot, ASP.NET, Rails, Gin. Pure static analysis — no code execution. Returns JSON with routes[], exports[], middleware[], lang, framework, and a plain-English summary. $0.10/call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoSource code to analyze (any language/framework). Max ~50KB recommended.
detailNoOutput scope: 'full' (default) = all fields; 'routes' = HTTP routes only; 'exports' = exported symbols only.
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the static analysis nature (no execution), cost per call, and supported frameworks. However, it lacks details on limitations (e.g., max code size, potential failure modes).

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 and front-loaded with purpose. It includes all key details in one paragraph. Could benefit from bullet points or more structured formatting, but it is effective and not verbose.

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

Completeness4/5

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

Given no output schema, the description explains the output JSON structure (routes[], exports[], etc.) and mentions cost. It covers supported frameworks and the nature of analysis. Missing error handling or explicit size limits beyond recommendation.

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%, so baseline is 3. The description does not add significant meaning beyond the schema's parameter descriptions (code and detail). The cost and output fields are mentioned, but not parameter-specific.

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 it analyzes code snippets to return API surface (routes, exports, middleware) and lists supported frameworks. It distinguishes itself from siblings like 'code-test-detector' by focusing on API-specific analysis.

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 mentions 'Pure static analysis — no code execution' which implies safety, but does not explicitly state when to use this tool over alternatives or provide exclusion criteria. Usage context is implied rather than explicit.

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/thebrierfox/the-stall'

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