Skip to main content
Glama

Generate API tests

generate_api_tests

Generate contract tests for selected or all API endpoints, validating status codes and JSON schemas with pytest/httpx or Java REST Assured (JUnit 5), and return test files for writing.

Instructions

Generate contract tests (status + JSON schema) for some or all endpoints: pytest + httpx, or Java REST Assured (JUnit 5). Returns the files; write them with write_test.

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": {
      "spec": "<spec>"
    },
    "name": "generate_api_tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
specYes
endpointsNo
frameworkNopytest
java_packageNocontract

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description does the important work of disclosing that the tool returns files rather than writing them, and that write_test is the subsequent step. It also specifies the test content (status and JSON schema) and the supported test frameworks, though it omits details such as permissions, limits, or file naming.

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 two tight sentences with the core purpose front-loaded. Every clause adds useful information: what is generated, how endpoints are scoped, framework choices, return behavior, and the required follow-up.

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?

For a four-parameter generator with no annotations and no output schema, the description covers the main purpose, return artifacts, and follow-up action. However, it leaves key parameter details unexplained, including the required spec input and the Java package option, so it is only minimally complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but it only clarifies the endpoints subset and framework choices. It never explains the required spec parameter or the java_package parameter, leaving half of the parameters semantically opaque.

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?

States a specific verb and resource: generate contract tests for endpoints, checking status and JSON schema. It also distinguishes the output artifacts from the follow-up write_test tool, so an agent can understand its role without opening the schema.

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

Usage Guidelines4/5

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

Gives clear usage context by saying it generates test files for some or all endpoints and that the returned files should be written with write_test. It does not explicitly state when not to use it or compare it against other sibling tools, but the follow-up routing is clear.

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