Skip to main content
Glama

api-automation

Automatically generates API types, endpoint constants, mock data, and request functions from backend API documentation to streamline integration and development workflows.

Instructions

理解后端接口文档自动生成接口类型、地址常量、mock数据、请求函数等

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiDocsYes后端接口文档内容

Implementation Reference

  • Registers the 'api-automation' MCP tool, defining its name, description, input schema (apiDocs string), and execute handler that constructs an XML prompt using imported prompt templates and the provided API documentation.
    private apiAutomation(): void {
      this.server.addTool({
        name: 'api-automation',
        description: '理解后端接口文档自动生成接口类型、地址常量、mock数据、请求函数等',
        parameters: z.object({
          apiDocs: z
            .string()
            .describe('后端接口文档内容'),
        }),
        execute: async ({
          apiDocs,
        }) => {
    
          const prompt: string = `
            <xml>
              <project-standard>${projectStandardsPrompt}</project-standard>
              <prompt>${apiAutomationPrompt}</prompt>
              <apiDocs>${apiDocs}</apiDocs>
            </xml>
          `
          return prompt
        },
      })
    }
  • src/server.ts:40-40 (registration)
    Invokes registerTools on the UtilityTools instance, which in turn calls apiAutomation() to register the 'api-automation' tool.
    this.utilityTools.registerTools()
  • The execute handler constructs and returns a structured XML prompt for API automation based on imported templates and the apiDocs input.
      execute: async ({
        apiDocs,
      }) => {
    
        const prompt: string = `
          <xml>
            <project-standard>${projectStandardsPrompt}</project-standard>
            <prompt>${apiAutomationPrompt}</prompt>
            <apiDocs>${apiDocs}</apiDocs>
          </xml>
        `
        return prompt
      },
    })
  • Zod schema defining the input parameter 'apiDocs' as a string describing the backend API documentation content.
    parameters: z.object({
      apiDocs: z
        .string()
        .describe('后端接口文档内容'),
    }),
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions generating outputs but doesn't describe how the tool behaves: whether it creates files, modifies existing code, requires specific permissions, has rate limits, or what happens on errors. The description is functional but lacks operational context needed for safe and effective use by an AI agent.

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 a single, efficient sentence in Chinese that directly states the tool's function. It's front-loaded with the core purpose and lists specific outputs. There's no wasted text, though it could be slightly more structured (e.g., separating use cases). It earns a 4 for being concise and to the point.

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

Completeness2/5

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

Given the complexity (generating multiple code artifacts from API docs), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., file paths, structured data), error conditions, or dependencies. For a tool that likely produces significant output, more context is needed to guide the agent effectively.

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 description doesn't explicitly mention parameters, but it implies the input is '后端接口文档' (backend API documentation), which aligns with the single parameter 'apiDocs'. Schema description coverage is 100%, so the schema already documents this parameter adequately. The description adds no additional semantic context beyond what's in the schema, meeting the baseline of 3 when schema coverage is high.

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: '自动生成接口类型、地址常量、mock数据、请求函数等' (automatically generates interface types, address constants, mock data, request functions, etc.). This specifies the verb ('生成' - generate) and resources (multiple outputs from API documentation). It's not perfectly specific about the exact scope, but it distinguishes from sibling tools which focus on Figma assets, colors, and project initialization rather than API automation.

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. It doesn't mention prerequisites (e.g., needing valid API documentation), exclusions, or comparisons to other tools. The sibling tools are unrelated (Figma/image processing), so there's no explicit differentiation within the same domain. Usage is implied by the mention of '后端接口文档' (backend API documentation) but not explicitly stated.

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

Related 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/Panzer-Jack/feuse-mcp'

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