Skip to main content
Glama

apply_grounding_fix

Destructive

Applies Marcora's recommended fix for one or more findings ("yes, do recommendation "). This WRITES to the user's library or document, so read each finding's suggested_fix and confirm with the user before applying.

When to use: the user has reviewed findings from check_content_grounding / get_grounding_result or from list_ci_findings (including health-audit recommendations from trigger_health_audit_scan) and wants them acted on. You never compose the fix yourself: pass finding_ids, and each finding's stored recommendation is applied. It is the same action as the Apply button in the Marcora UI: same permissions (admin or editor), same billing, same result.

Where each fix lands: by default the context item named in that finding's context_item_id; a null context_item_id means the content document itself. Pass context_item_overrides to redirect a specific finding elsewhere (the UI's destination picker).

Asynchronous: returns at once with one job per finding. Findings whose fixes land in the same document run together and share a generation_id: poll each distinct generation_id once with get_generation_status. Brand Foundation findings are not grouped. The honest outcome is document_updated there: true means the document changed, false means the recommendation was already covered and nothing was written. Report that distinction; don't assume every applied fix changed something.

Partial success is normal: findings that could not start come back in errors[] with a reason while the rest run. Check both jobs[] and errors[].

Serves BOTH families of finding on the shared substrate: content-grounding findings (from a grounding scan) and Context Intelligence health-audit recommendations (from trigger_health_audit_scan). One tool for both. For a shared generation_id, document_updated covers every finding in that run.

Errors:

  • Missing param: finding_ids (400). Pass finding_id values from a prior findings response.

  • InputError: finding_ids must be finding_id UUIDs (400).

  • InputError: context_item_overrides names a finding not in finding_ids (400). The override would be ignored, so it is rejected rather than silently dropped.

  • You are not authorized to perform this action (403). Applying requires an admin or editor role.

  • This finding is not a content grounding finding / has already been resolved (400). Per finding, surfaced in errors[].

  • Marcora is already updating this document. Per finding, surfaced in errors[]: another run on that document (for example the user's own Content Assistant request, or an earlier apply_grounding_fix call) is still in progress. Wait for it to finish, then retry those findings.

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": {
      "finding_ids": "<finding_ids>"
    },
    "name": "apply_grounding_fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
finding_idsYesRequired. The finding_id values to apply, from check_content_grounding, get_grounding_result or list_ci_findings. Pass one or many.
context_item_overridesNoOptional. Redirect specific fixes: a map of finding_id to the context_item_id it should be written to instead of the finding's default target. Every key must also appear in finding_ids. Mirrors the destination picker in the Marcora UI.

Output Schema

NameRequiredDescriptionDefault
jobsNoOne entry per finding that started. Jobs whose fixes land in the same document share a generation_id (one run applies them together); poll each distinct generation_id with get_generation_status.
errorsNoFindings that could not be started. The other findings still ran — this is a partial success, not a total failure.
queuedNoHow many assistant runs actually started.
skippedNoHow many could not be started — see errors[].
requestedNoHow many findings were submitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructive=true, idempotent=false, readOnly=false, but the description goes well beyond them: it discloses that the call is asynchronous, returns one job per finding, groups fixes by `generation_id`, that partial success surfaces in `errors[]` alongside `jobs[]`, and that `document_updated: false` can legitimately mean nothing was written. It also enumerates the authorization requirement (admin or editor) and a document-lock failure mode with retry guidance.

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?

Bold headers, front-loaded async warning, and an explicit error list make it skimmable despite the length. The 'Serves BOTH families of finding' paragraph partly restates what 'When to use' already established, which is the one place a sentence could be trimmed.

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 destructive, asynchronous, multi-target mutation with nested override semantics, this covers the trigger conditions, the write destination logic, the polling follow-up, partial-failure handling, and every enumerated error. An agent can invoke and recover from it without consulting any other documentation.

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 both parameters are already documented, yet the description adds real meaning: a null `context_item_id` means the write targets the content document itself, and `context_item_overrides` is the equivalent of the UI destination picker and is rejected rather than silently ignored if a key is missing from `finding_ids`. It stops short of showing the shape of an override map, but the schema carries that.

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 opening sentence gives a specific verb (applies) plus the resource (a stored recommendation for one or more findings) and immediately clarifies the agent never composes the fix itself. It is unambiguously distinct from siblings like `get_ci_finding`, `list_ci_findings`, and `update_ci_finding_status`, which read or triage findings rather than acting on them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

The 'When to use' section names the exact upstream tools whose output qualifies (`check_content_grounding`, `get_grounding_result`, `list_ci_findings`, `trigger_health_audit_scan`) and adds a precondition: read each finding's `suggested_fix` and confirm with the user before applying. It also maps the tool to the UI Apply button so the agent can reason about parity with user expectations.

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