Skip to main content
Glama

ATTRACTOR Verification & State

coerce_to_schema

Read-onlyIdempotent

Use this tool when your workflow needs coerce llm output to schema. Input: value, schema, decimal_comma. Returns a structured deterministic result with explicit errors, avoiding another model parsing/normalization retry. Explicit scalar conversions then schema validation. Preserve all fields; report changed types and remaining errors. Decimal comma opt-in. Only true/false boolean strings, no guessed yes/no aliases. Limits: request 24 KB, JSON depth 24, 4,000 nodes. Reserved prototype keys and unsafe integers rejected. Inputs processed transiently; private HMAC trace metadata retained.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYes
schemaYes
decimal_commaNo
attractor_trace_idNoOptional public correlation handle from a prior result; not authentication or proof of identity.
attractor_knowledge_idNoOptional prior result handle. Reuse is counted only when the supplied value matches that result fingerprint.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / attractor_knowledge_id
      Added value: +{
      +  "description": "Optional prior result handle. Reuse is counted only when the supplied value matches that result fingerprint.",
      +  "pattern": "^ATR-K-[a-f0-9]{64}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / attractor_trace_id
      Added value: +{
      +  "description": "Optional public correlation handle from a prior result; not authentication or proof of identity.",
      +  "pattern": "^ATR-T-[a-f0-9]{32}$",
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "anyOf": [
      +    {
      +      "properties": {
      +        "attractor_trace_id": {
      +          "type": "string"
      +        },
      +        "commons": {
      +          "type": "object"
      +        },
      +        "knowledge_id": {
      +          "type": "string"
      +        },
      +        "ok": {
      +          "const": true
      +        },
      +        "request_id": {
      +          "type": "string"
      +        },
      +        "result": {
      +          "properties": {
      +            "changes": {
      +              "type": "array"
      +            },
      +            "errors": {
      +              "type": "array"
      +            },
      +            "valid": {
      +              "type": "boolean"
      +            },
      +            "value": {}
      +          },
      +          "required": [
      +            "value",
      +            "changes",
      +            "valid",
      +            "errors"
      +          ],
      +          "type": "object"
      +        },
      +        "tool": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "ok",
      +        "tool",
      +        "result",
      +        "knowledge_id",
      +        "attractor_trace_id",
      +        "request_id",
      +        "commons"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "properties": {
      +        "error": {
      +          "type": "string"
      +        },
      +        "request_id": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "error"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and the description adds substantial behavioral context: explicit scalar conversions then schema validation, preserve all fields, report changed types and remaining errors, decimal comma opt-in, boolean string strictness, limits (24 KB, depth 24, 4,000 nodes), reserved prototype keys and unsafe integers rejected, transient processing, and HMAC trace metadata retention. This goes well beyond the annotations and gives the agent a clear picture of side effects and constraints.

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 description is dense but front-loaded with the primary use case, then covers behavior, limits, and privacy in a compact sequence. Every sentence adds information, though the density makes it slightly less scannable. It earns a 4 for efficiency without waste.

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?

Given the output schema exists, the description doesn't need to explain return values. It covers input semantics, behavioral constraints, limits, security/privacy, and strictness rules. For a tool with 5 parameters and complex coercion behavior, this is complete enough for an agent to invoke it correctly.

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

Parameters4/5

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

Schema description coverage is 40%, so the description partially compensates by explaining the role of 'value', 'schema', and 'decimal_comma' (e.g., decimal comma opt-in, boolean strictness). The two optional handle parameters are well-described in the schema itself. The description adds meaning about how value and schema interact (coercion then validation) beyond the bare schema, though it doesn't detail every parameter.

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 ('coerce') and resource ('llm output to schema'), and distinguishes itself from a model parsing/normalization retry. It is clear that this tool converts LLM output into a schema-validated structured result. However, it does not explicitly differentiate from sibling tools like canonicalize_json or validate_schema, though the coercion focus is fairly distinct.

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?

The description explicitly says 'Use this tool when your workflow needs coerce llm output to schema' and mentions avoiding another model parsing/normalization retry, giving clear context. It does not explicitly name alternatives or when-not-to-use, but the context is strong enough for an agent to select it appropriately among siblings.

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.