Skip to main content
Glama

Nested-object flattening module with pytest tests

submit_nested_flattening
Idempotent

Produce a standard-library Python module that flattens a nested object into dotted-path keys, plus pytest tests. Choose this when a nested object must become single-level dotted-path keys, leaving lists as leaves. Do not choose this if you need lists indexed into keys (a.0, a.1) or a custom separator: the template fixes the behaviour. Example requests: Write a Python module that flattens a nested object into dotted-path keys, with tests. | I need nested JSON flattened to single-level keys like a.b.c. | Generate a flattening module 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_nested_flattening"
  }
}

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.
idempotency_keyNoRetry key. Re-sending the same key returns the same job instead of running it twice.
payment_signatureNoBase64-encoded x402 payment payload (the value the HTTP interface puts in the PAYMENT-SIGNATURE header), signed for the amount in the payment requirement the first call returned. Required for a priced capability; nothing is charged until the work completes.

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. Changed2 schema fields changed
    • addedInput schema / properties / idempotency_key
      Added value: +{
      +  "description": "Retry key. Re-sending the same key returns the same job instead of running it twice.",
      +  "type": "string"
      +}
    • addedInput schema / properties / payment_signature
      Added value: +{
      +  "description": "Base64-encoded x402 payment payload (the value the HTTP interface puts in the PAYMENT-SIGNATURE header), signed for the amount in the payment requirement the first call returned. Required for a priced capability; nothing is charged until the work completes.",
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / state / enum
      Previous value: -[
      -  "received",
      -  "rejected",
      -  "quoted",
      -  "authorized",
      -  "executing",
      -  "deferred",
      -  "verifying",
      -  "completed",
      -  "failed",
      -  "timed_out",
      -  "cancelled"
      -]New value: +[
      +  "received",
      +  "rejected",
      +  "quoted",
      +  "authorized",
      +  "executing",
      +  "deferred",
      +  "queued",
      +  "verifying",
      +  "completed",
      +  "failed",
      +  "timed_out",
      +  "cancelled"
      +]
  3. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true, and destructiveHint=false, and the description usefully adds that the behaviour is fixed by the template and verified by its own tests, plus that lists remain leaves. It says nothing about the priced/authorized job workflow (quote, payment signature) that dominates this tool's actual runtime behaviour, so the added context is partial.

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?

Purpose, selection rule, and exclusion are front-loaded and each sentence carries weight. The three example requests restate the same intent in near-identical phrasing, which is the only padding.

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

Completeness5/5

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

With an output schema present and 83% parameter coverage, the description only needs to establish purpose and selection boundaries, which it does. Combined with annotations, an agent has enough to decide when to call this versus other module-generation tools and what shape of request to send.

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 83%, so the schema already documents module_name, function_name, template, quote_id, payment_signature, and idempotency_key in detail. The description only reinforces that the template pins behaviour; it adds no naming constraints, price-matching semantics, or retry guidance beyond the schema. Baseline 3 is appropriate.

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 first sentence names a concrete deliverable: a standard-library Python module that flattens a nested object into dotted-path keys, plus pytest tests. The scope clause (lists stay as leaves) and the exclusions (no numeric list indexing, no custom separator) make it unambiguous which of the many submit_*_module siblings this is.

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?

It gives both a when-to-use condition ("Choose this when a nested object must become single-level dotted-path keys") and explicit when-not conditions (list indexing, custom separator). It stops short of routing the agent to a named alternative tool for those excluded cases, so the guidance is strong but not fully closed-loop.

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