Skip to main content
Glama

Audit and clean JSON rows

trust_clean_data
Read-onlyIdempotent

Audit and optionally clean up to 500 JSON rows, returning cleaned_rows, original zero-based issues and counts. Processing order is trim, primary-key deduplication, then required/range checks: keys " a " and "a" collide after trimming. Duplicate removal keeps the first row and skips later-row field checks; missing keys are retained and flagged. REVIEW persists even after repair, so inspect issues before use; [] returns ALLOW. Numeric strings are not converted or range-checked; use trust_validate_data for type enforcement. Only top-level strings are trimmed; inputs are not mutated. Free, unauthenticated, stateless pilot: rules apply only to this call. Usage metadata is recorded; request bodies are not stored.

Input Schema

NameRequiredDescriptionDefault
rowsYesJSON object rows; at most 500. An empty array is valid.
primary_keyNoTop-level key used for duplicate detection; defaults to id. Keys compare by JSON serialization, so 1 differs from "1".id
trim_stringsNoTrim leading/trailing whitespace from top-level strings; nested values are unchanged.
numeric_rangesNoInclusive bounds for top-level fields that already contain numbers. Use validation for numeric type enforcement.
required_fieldsNoTop-level field names that must be present and non-null/non-empty. Checked after optional trimming.
remove_duplicatesNoDrop later rows with the same primary key; missing keys are flagged and retained. Duplicate rows are skipped before required/range checks.

Output Schema

NameRequiredDescriptionDefault
okYesThe operation completed; does not imply the verdict is ALLOW.
issuesYesAudit findings with original zero-based row positions.
serviceYesService that evaluated the request.
verdictYesALLOW: no findings. REVIEW: inspect issues, including removed duplicates. BLOCK: invalid row input.
versionYesDeployed implementation version.
warningYesDeterministic cleanup limitations.
input_countYesOriginal row count.
cleaned_rowsYesNew row objects after the selected transformations.
output_countYesReturned row count.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/destructive/idempotent annotations: defines the deterministic processing order (trim → PK dedup → required/range checks), states dedup keeps the first row and skips later-row field checks, that missing keys are retained and flagged, that numeric strings are neither converted nor range-checked, that only top-level strings are trimmed, and that inputs are not mutated. It also discloses the operating model (free, unauthenticated, stateless, per-call rules) and the privacy posture (usage metadata recorded, bodies not stored).

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?

Front-loaded: purpose and return values land in the first clause, with behavioral caveats after. It is dense and semicolon-heavy – some sentences pack two distinct facts (e.g. the collision note) – but nearly every sentence carries decision-relevant information.

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?

For a six-parameter, stateful-behaving audit tool with an output schema already covering return structure, the description covers the remaining risk surface: ordering effects, what dedup drops, what gets flagged but retained, and the REVIEW-does-not-clear warning. Nothing an agent needs to call it correctly is missing.

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 coverage is 100%, so the schema already carries the per-parameter burden and baseline is 3. The description still adds semantics the schema does not spell out as clearly: the 500-row ceiling, the trim-collision example ('a ' and 'a' collide), and the fact that duplicate removal short-circuits later required/range checks on skipped rows.

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?

First sentence gives a specific verb pair ('audit and optionally clean'), the resource ('JSON rows'), the hard scope (up to 500), and the return shape (cleaned_rows, zero-based issues, counts). It also names the sibling it is not (trust_validate_data) for type enforcement, so the agent can tell the two apart without opening either 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?

Explicitly routes type-enforcement work to trust_validate_data and warns to inspect issues before use because REVIEW persists after repair, plus notes that an empty array returns ALLOW. Clear usage context, but it does not say when to prefer this over the other audit-related siblings (trust_check_action, trust_check_spend).

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