Skip to main content
Glama
nihar777

apollo-cache-copilot

Diagnose cache graph

diagnose_cache_graph
Read-only

Diagnose Apollo cache normalization issues by inspecting a serialized cache, then receive a step-by-step repair plan with proposed patch operations to feed into patch_cache.

Instructions

Run the full inspect -> reason -> plan graph over a serialized cache. Returns findings, the proposed patch operations (feed them to patch_cache), and per-step narration. Plans only; never mutates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cacheYesThe full serialized cache, exactly as returned by `cache.extract()`. Keys are cache IDs (e.g. "ROOT_QUERY", "User:1"); values are that entity's stored fields, which may contain `{ "__ref": "<cache id>" }` pointers to other entries in this same object.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
findingsYesEvery defect the inspector found in `cache`.
narrationYes
proposedPatchesYesMechanically-derived fixes for the fixable findings, ready to pass to patch_cache as-is.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed8 schema fields changedv1.0.2
    • addedInput schema / properties / cache / additionalProperties / description
      Added value: +"One normalized store entry: the raw field/value map Apollo keeps under a single cache key."
    • addedInput schema / properties / cache / description
      Added value: +"The full serialized cache, exactly as returned by `cache.extract()`. Keys are cache IDs (e.g. \"ROOT_QUERY\", \"User:1\"); values are that entity's stored fields, which may contain `{ \"__ref\": \"<cache id>\" }` pointers to other entries in this same object."
    • addedOutput schema / properties / findings / description
      Added value: +"Every defect the inspector found in `cache`."
    • addedOutput schema / properties / findings / items / properties / danglingRef / description
      Added value: +"The unresolved cache key the ref pointed at. Only present when kind is ORPHANED_REF."
    • addedOutput schema / properties / findings / items / properties / message / description
      Added value: +"Human-readable explanation of this finding."
    • addedOutput schema / properties / findings / items / properties / path / description
      Added value: +"Dotted path to the defect from its cache key, e.g. \"User:2.posts.1\"."
    • addedOutput schema / properties / proposedPatches / description
      Added value: +"Mechanically-derived fixes for the fixable findings, ready to pass to patch_cache as-is."
    • changedOutput schema / properties / proposedPatches / items / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "broadcast": {
      -        "default": true,
      -        "type": "boolean"
      -      },
      -      "fields": {
      -        "additionalProperties": {
      -          "oneOf": [
      -            {
      -              "additionalProperties": false,
      -              "properties": {
      -                "action": {
      -                  "const": "DELETE",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "action"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "additionalProperties": false,
      -              "properties": {
      -                "action": {
      -                  "const": "INVALIDATE",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "action"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "additionalProperties": false,
      -              "properties": {
      -                "action": {
      -                  "const": "SET",
      -                  "type": "string"
      -                },
      -                "value": {}
      -              },
      -              "required": [
      -                "action",
      -                "value"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "additionalProperties": false,
      -              "properties": {
      -                "action": {
      -                  "const": "PRUNE_DANGLING_REFS",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "action"
      -              ],
      -              "type": "object"
      -            }
      -          ]
      -        },
      -        "propertyNames": {
      -          "type": "string"
      -        },
      -        "type": "object"
      -      },
      -      "id": {
      -        "default": "ROOT_QUERY",
      -        "type": "string"
      -      },
      -      "optimistic": {
      -        "default": false,
      -        "type": "boolean"
      -      },
      -      "type": {
      -        "const": "modify",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "type",
      -      "id",
      -      "fields",
      -      "optimistic",
      -      "broadcast"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "args": {
      -        "additionalProperties": {},
      -        "propertyNames": {
      -          "type": "string"
      -        },
      -        "type": "object"
      -      },
      -      "broadcast": {
      -        "default": true,
      -        "type": "boolean"
      -      },
      -      "fieldName": {
      -        "type": "string"
      -      },
      -      "id": {
      -        "type": "string"
      -      },
      -      "type": {
      -        "const": "evict",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "type",
      -      "id",
      -      "broadcast"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "broadcast": {
      +        "default": true,
      +        "description": "Notify active queries/subscriptions of this change. Set false to patch silently.",
      +        "type": "boolean"
      +      },
      +      "fields": {
      +        "additionalProperties": {
      +          "oneOf": [
      +            {
      +              "additionalProperties": false,
      +              "description": "Remove this field from the entity entirely.",
      +              "properties": {
      +                "action": {
      +                  "const": "DELETE",
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "action"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "description": "Mark this field stale so Apollo refetches it, without removing or changing its value.",
      +              "properties": {
      +                "action": {
      +                  "const": "INVALIDATE",
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "action"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "description": "Overwrite this field with `value` (any JSON — a scalar, object, or `{ \"__ref\": \"<cache id>\" }`).",
      +              "properties": {
      +                "action": {
      +                  "const": "SET",
      +                  "type": "string"
      +                },
      +                "value": {}
      +              },
      +              "required": [
      +                "action",
      +                "value"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "description": "Drop any `__ref` pointer(s) this field holds that no longer resolve to an entity in the cache. Works on a single ref or a list of refs; refs that still resolve are left untouched.",
      +              "properties": {
      +                "action": {
      +                  "const": "PRUNE_DANGLING_REFS",
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "action"
      +              ],
      +              "type": "object"
      +            }
      +          ]
      +        },
      +        "description": "Map of field name -> FieldPatch describing how to change that one field.",
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "id": {
      +        "default": "ROOT_QUERY",
      +        "description": "Cache key of the entity to modify, e.g. \"User:2\". Defaults to \"ROOT_QUERY\" if omitted.",
      +        "type": "string"
      +      },
      +      "optimistic": {
      +        "default": false,
      +        "description": "Apply against the optimistic layer instead of the base cache. Mirrors `cache.modify`'s option.",
      +        "type": "boolean"
      +      },
      +      "type": {
      +        "const": "modify",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "id",
      +      "fields",
      +      "optimistic",
      +      "broadcast"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "args": {
      +        "additionalProperties": {},
      +        "description": "Field arguments to match when evicting a specific parameterized field (used with `fieldName`).",
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "broadcast": {
      +        "default": true,
      +        "description": "Notify active queries/subscriptions of this eviction. Set false to patch silently.",
      +        "type": "boolean"
      +      },
      +      "fieldName": {
      +        "description": "Evict only this one field instead of the whole entity at `id`.",
      +        "type": "string"
      +      },
      +      "id": {
      +        "description": "Cache key of the entity to evict, e.g. \"Post:5\".",
      +        "type": "string"
      +      },
      +      "type": {
      +        "const": "evict",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "id",
      +      "broadcast"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true, and the description reinforces this with 'Plans only; never mutates.' It adds useful behavioral context about what the tool does not do and how its output should be consumed, going beyond the structured annotation without contradicting it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences deliver the pipeline, the return value, the downstream consumer, and the side-effect guarantee. Every phrase earns its place and the most important behavioral constraint is front-loaded.

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 single-parameter tool with a fully documented schema and an output schema, the description is complete: it names the inputs, outputs, downstream action, and non-mutating behavior. Nothing an agent needs to invoke it correctly is missing.

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?

The input schema already provides 100% coverage, including a detailed description of the cache object and its structure. The tool description does not need to restate parameter details; the schema carries the semantic weight, so the baseline score of 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 description names a specific verb and resource ('Run the full inspect -> reason -> plan graph over a serialized cache') and clearly differentiates itself from the sibling tools by describing its broader pipeline. It also states what it returns, making its role unambiguous.

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 provides clear context for when this tool fits: it produces patch operations that should be fed to patch_cache, and it is a planning-only step. It does not explicitly state when to prefer it over inspect_dangling_refs, but the pipeline framing and output-to-patch_cache relationship make the usage context clear.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nihar777/apollo-cache-copilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server