Skip to main content
Glama

Malformed-record detection module with pytest tests

submit_malformed_record_detection
Idempotent

Produce a standard-library Python module that reports records violating a fixed field contract, plus pytest tests. Choose this when you need one entry per offending record, naming its index and the rule it broke, against a fixed contract. Do not choose this for a contract outside the registered template, or if you need the records corrected rather than reported. Example requests: Write a Python module that finds records violating a fixed field contract, with tests. | I need a checker that reports the index and failed rule for each bad record. | Generate a malformed-record detector and prove it with pytest.

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": {
      "inputs": "<inputs>",
      "authorized_by": "<authorized_by>"
    },
    "name": "submit_malformed_record_detection"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputsYes
quote_idNoThe quote_id returned by POST /v1/jobs. Required to authorize a priced capability; the service rejects a priced job that does not name the quote it issued.
authorized_byYesIdentifier of the human or agent authorizing this job.
accepted_priceNoThe amount accepted, exactly as quoted (for example "5.00" or 5). Checked against the stored quote, so a price that moved between quote and authorize is refused rather than silently absorbed. Optional, but sent to make the acceptance explicit.

Output Schema

NameRequiredDescriptionDefault
quoteNo
stateYes
job_idYes
artifactsNo
access_tokenNoPer-job credential. Present it as the X-Job-Token header to read the job or list it. Keep it; it is the only credential for this job.
verificationNoIndependent verification. verification.ok = false means the job failed, not a partial success.
capability_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly=false, idempotent=true, destructive=false and closed-world, so the safety profile is covered. The description adds genuinely useful generation-time context: the output is a standard-library module plus tests, and the contract is fixed by the template and verified by the template's own tests. It does not mention the priced-job/quote authorization flow or that the job is gated on a quote, which is meaningful behavior for a submitted job.

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 core scope and exclusions are front-loaded in the first three sentences, which is the right ordering for routing. The three example requests are somewhat redundant with the preceding sentences and pad the definition, but they are short and do reinforce the intended artifact.

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?

With an output schema present, the description needn't explain return values, and annotations cover mutation semantics. Together with the schema, an agent has enough to select and call the tool. The remaining gap is that the priced/authorization nature of the job (quote_id, accepted_price) is left entirely to the schema.

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 75% and the nested inputs object documents module_name, function_name and template with patterns and semantics. The description reinforces the 'registered template' constraint on the template parameter but says nothing about module_name, function_name, quote_id, accepted_price or authorized_by. Baseline 3 is appropriate when the schema is already doing most of the work.

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 states a specific verb and artifact: produce a standard-library Python module that reports records violating a fixed field contract, plus pytest tests. It also distinguishes scope by saying it is not for contracts outside the registered template and not for correcting records. It stops short of naming the closest siblings (e.g., submit_data_validation_module, submit_field_mapping), so the boundary with those is inferred rather than explicit.

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?

There is an explicit 'choose this when' clause tied to the exact output shape (one entry per offending record with index and broken rule) and two explicit exclusions (out-of-template contracts, and correction rather than reporting). What is missing is a named alternative for those excluded cases, so the agent knows where to route instead of only where not to go.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources