Skip to main content
Glama
mdz-axo

PT-MCP (Paul Test Man Context Protocol)

by mdz-axo

extract_api_surface

Extract and document the public API surface from codebases to generate structured documentation in markdown, JSON, or TypeScript formats.

Instructions

Extract and document public API surface of the codebase

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesRoot directory path
include_privateNoInclude private/internal APIs
output_formatNoOutput format for API documentationmarkdown

Implementation Reference

  • Main handler function that executes the extract_api_surface tool logic. Currently a stub implementation returning a pending message.
    export async function extractApiSurface(
      args: ExtractApiSurfaceArgs
    ): Promise<{ content: Array<{ type: string; text: string }> }> {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                message: "API surface extraction - implementation pending",
                path: args.path,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • TypeScript interface defining the input arguments for the extract_api_surface tool.
    interface ExtractApiSurfaceArgs {
      path: string;
      include_private?: boolean;
      output_format?: "markdown" | "json" | "typescript";
    }
  • JSON schema definition for the extract_api_surface tool, used in ListTools response.
      name: "extract_api_surface",
      description: "Extract and document public API surface of the codebase",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "Root directory path",
          },
          include_private: {
            type: "boolean",
            description: "Include private/internal APIs",
            default: false,
          },
          output_format: {
            type: "string",
            enum: ["markdown", "json", "typescript"],
            description: "Output format for API documentation",
            default: "markdown",
          },
        },
        required: ["path"],
      },
    },
  • Registration of the extract_api_surface handler in the tool dispatch switch statement.
    case "extract_api_surface":
      return await extractApiSurface(args as any);
  • src/index.ts:47-47 (registration)
    Call to registerTools which sets up the CallToolRequestSchema handler dispatching to individual tools including extract_api_surface.
    registerTools(server);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions extraction and documentation but doesn't specify whether this is read-only, destructive, requires permissions, has rate limits, or details the output behavior. This leaves significant gaps for a tool that likely interacts with codebases.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It's appropriately sized for the tool's complexity, making it easy to parse and understand quickly.

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 tool's moderate complexity (3 parameters, no output schema, no annotations), the description is adequate but incomplete. It states what the tool does but lacks details on behavioral traits, usage context, and output expectations, which are crucial for effective agent invocation in a code analysis environment.

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?

The input schema has 100% description coverage, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what's in the schema, such as explaining why to include private APIs or how output formats differ. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/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 with specific verbs ('extract and document') and resource ('public API surface of the codebase'), making it immediately understandable. However, it doesn't explicitly distinguish this from sibling tools like 'analyze_codebase' or 'extract_patterns', which might have overlapping functionality, so it doesn't reach the highest score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'analyze_codebase' or 'extract_patterns', nor does it mention prerequisites or exclusions. It implies usage for API documentation but lacks explicit context, resulting in a minimal score.

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/mdz-axo/pt-mcp'

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