Skip to main content
Glama

contract_guard

Automatically extract field structures from frontend API responses to generate consumer contracts and prevent backend API drift. Supports direct endpoint calls or network log extraction.

Instructions

从前端实际消费的 API 响应中自动提取字段结构,生成 consumer contract(消费者契约),防止后端 API 漂移。支持两种来源:直接调用指定端点,或从已捕获的 network 日志中提取。先做进现有 MCP,后续再剥离。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNo从 network 日志提取的时间起点,默认当前 checkpoint
endpointsNo要直接调用并生成契约的端点列表,每项包含 path/url/method/headers/body
fromNetworkNo是否从已捕获的 network 日志中提取 API 响应生成契约,默认 true
urlContainsNo只处理 URL 包含此字符串的请求
autoDiscoverNo是否自动从 network 日志发现 API 端点(当 endpoints 为空时生效),默认 false
baselineNameNo基线名称,默认 'default'。支持多套基线
saveBaselineNo是否将本次生成的 contracts 保存为基线,默认 false。保存后可用于后续对比
compareBaselineNo是否与已保存的基线对比,检测 schema 漂移,默认 false
Behavior2/5

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

No annotations are provided, so the description must carry the full burden. It does not disclose whether the tool modifies state, saves data, or has destructive effects. The note about temporary integration is not relevant behavioral info.

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

Conciseness3/5

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

The description is relatively concise but includes an implementation detail ('先做进现有 MCP,后续再剥离') that is not helpful for tool selection. The purpose is front-loaded, but the note reduces efficiency.

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 8 parameters, no output schema, and no annotations, the description lacks details on return values, side effects, and how contracts are stored or used. The concept of 'baseline' is mentioned but not explained.

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 adds no extra meaning beyond the parameter names and descriptions. It fails to clarify parameter interactions (e.g., when both endpoints and fromNetwork are set).

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: automatically extract field structure from frontend API responses to generate consumer contracts and prevent backend API drift. It specifies the resources (API responses, consumer contracts) and mentions two sources. However, it does not explicitly differentiate from sibling tools like 'contract' or 'contract_baseline'.

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 mentions two sources (direct endpoint calls or network logs) but provides no guidance on when to use each, nor does it contrast with alternative contract tools. This leaves the agent without clear usage criteria.

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/validpilot/ai-verify-mcp'

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