Skip to main content
Glama
k11 API Functional QA

k11 API Functional QA

Official

Generate negative tests

generate_negative_tests

Generates negative and boundary test cases from an API spec for one endpoint, covering missing fields, wrong types, enum and limit violations, and missing credentials, expecting 4xx responses only.

Instructions

Negative and boundary tests for one operation (e.g. 'POST /orders'), derived from the spec, including nested fields and array items: missing required fields, wrong types, values outside enums and min/max/length/item limits, missing parameters, no credentials, unknown IDs. Every case must get a 4xx, never a 5xx; boundary cases that must be accepted clean up after themselves. base_values supplies real values for the valid parts (e.g. {"customerId": "${fixture.customer.id}"}) with fixtures=["customer"]. Save the result with write_flow.

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": {
      "endpoint": "<endpoint>"
    },
    "name": "generate_negative_tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
specNo
endpointYes
fixturesNo
base_valuesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the pass criteria (every case must yield 4xx, never 5xx) and that accepted boundary cases clean up after themselves, which tells the agent this has side effects on the target system. It stops short of saying whether cases are executed against a live endpoint or merely generated, and says nothing about credentials or rate limits.

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?

Dense but front-loaded: the core capability and the 4xx assertion come first, then the parameter guidance, then the save step. The enumerated case list is long but each item adds real scope information rather than repeating the title.

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

Completeness4/5

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

For a 4-parameter tool with no annotations and no output schema, the description covers scope, assertions, fixture wiring, and the handoff to write_flow, which is enough to invoke it correctly. The residual gap is what the tool actually returns and whether it runs the cases or only produces them.

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 0%, so the description must compensate; it explains base_values with a concrete example ({"customerId": "${fixture.customer.id}"}) and ties it to fixtures=["customer"], and illustrates endpoint via 'POST /orders'. The spec parameter is never explained, so one of four parameters remains opaque in both schema and description.

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?

The description states a specific verb and resource — negative and boundary test generation for a single operation, exemplified as 'POST /orders' — and enumerates the case classes (missing required fields, wrong types, enum/min-max violations, no credentials, unknown IDs). An agent can tell exactly what output to expect 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 Guidelines3/5

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

It tells the agent the terminal step ('Save the result with write_flow') and the prerequisite coupling between base_values and fixtures, which is genuinely useful routing. However, it never says when to prefer this over drafting a flow or calling the API directly, and no when-not condition is given.

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