Skip to main content
Glama

validate-api

Checks Java, JavaScript, and TypeScript API code for compliance with standards so issues are caught before tests or documentation.

Instructions

校验API代码是否符合规范

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>",
      "language": "<language>"
    },
    "name": "validate-api"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes要校验的代码内容
languageYes编程语言

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and provides almost none of it: it does not say whether validation is read-only, which style guide or rule set is applied, whether severity levels exist, or what happens with unsupported syntax. Only the inherent read-only nature of 'validate' gives the agent any behavioral cue.

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?

A single short, front-loaded sentence with no filler; the purpose is stated immediately. Its terseness borders on under-specification, but there is no wasted wording to penalize.

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?

With no output schema, the description should explain what a validation result looks like (violation list, line references, pass/fail), and it does not. For a tool whose entire value is its findings, the absence of any return-value or ruleset context leaves a meaningful gap.

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 description coverage is 100% and both parameters carry their own descriptions plus an enum for language, so the schema does all the semantic work. The description adds nothing about how the code content should be scoped or how language selection changes the rules applied.

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 names a specific verb and resource ('校验' + 'API代码') plus the criterion ('是否符合规范'), so an agent can tell this checks code against a standards ruleset. It does not differentiate itself from the sibling tools generate-openapi and generate-tests, but those are generators rather than validators, so the purpose gap is minor.

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?

There is no guidance on when to call this versus the generator siblings, no prerequisites, and no statement of which ruleset or standard '规范' refers to. The only usage signal is implied by the verb 'validate' itself.

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

Deploy Server

Other Tools