Skip to main content
Glama

Compare Javascript Export Shapes

compare_javascript_export_shapes
Idempotent

Compares static return-property shapes for the same JavaScript module export across two authenticated application graphs, reporting JSON Pointer additions and removals without executing code.

Instructions

Compare static return shapes for one exact module/export selector on each authenticated JavaScript Application Graph supplied as inline Evidence or exact same-session retained references. Variants pair only by reciprocal unique literal discriminants. Each retained variant lists observed return-property names even when values stay unknown. Presence (present, absent, or unknown-coverage) is separate from value resolution: a name present on only one paired shape is added or removed when parent-property coverage is complete on both sides, including when the static value is unresolved. Dynamic values, incomplete parent coverage, and unpaired variants remain unknown. Reports JSON Pointer changes without executing JavaScript; runtime behavior requires a separate agent-run probe.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "left": {
        "kind": "retained-evidence",
        "evidence_id": "ev_4765fd4d9759fef74a86e517349e3cc8292dd9d17b2544d40eddc6c7693341a1"
      },
      "right": {
        "kind": "retained-evidence",
        "evidence_id": "ev_63d875a91fea7479b1dc9d31ad7e7ee41bc5b7b15f0b3e687f5cae087c29a236"
      },
      "left_export_name": "default",
      "left_module_path": "parser.mjs",
      "right_export_name": "default",
      "right_module_path": "parser.mjs"
    },
    "name": "compare_javascript_export_shapes"
  }
}

Input Schema

NameRequiredDescriptionDefault
leftYesLeft-hand input used for comparison or differential execution.
rightYesRight-hand input used for comparison or differential execution.
left_export_nameYes
left_module_pathYesLocal filesystem path for left module.
right_export_nameYes
right_module_pathYesLocal filesystem path for right module.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare idempotent, non-destructive, closed-world, but notably readOnlyHint=false, and the description supplies the missing context: inputs must come from an 'authenticated' graph as inline Evidence or 'exact same-session retained references', and the tool emits JSON Pointer changes without executing JavaScript. It also discloses the uncertainty model (dynamic values, incomplete parent coverage, and unpaired variants stay unknown), which is real behavioral information not present in annotations. It does not explain what, if anything, gets mutated to justify readOnlyHint=false, but it does not contradict it either.

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

Conciseness3/5

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

The what-is-it sentence is correctly front-loaded, but the remainder is a dense run of jargon-heavy rules with overlapping restatement ('even when values stay unknown' and 'including when the static value is unresolved' say nearly the same thing). Every clause carries technical meaning, yet the lack of structure (no separation of pairing rules, coverage rules, and output) makes it harder to scan than its length warrants.

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

Completeness4/5

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

With no output schema and non-trivial comparison semantics, the description carries the burden well: it explains what is reported (JSON Pointer changes), how variants are paired, and precisely which conditions yield unknown versus added/removed. Gaps remain around the 'authenticated graph' prerequisite and same-session retention requirements, which an agent needs before it can construct valid inputs. Overall it is close to complete for a tool of this complexity.

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 67%, above the baseline threshold, and the schema already describes left/right as 'left-hand input used for comparison' plus the module path fields. The description adds meaning by clarifying that left/right may be either inline Evidence or exact same-session retained references and that a single module/export selector is required per side. It says nothing about the required pairing constraints on left_module_path/left_export_name, so it only marginally exceeds the schema.

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 first sentence names a specific verb and resource: compare static return shapes for one exact module/export selector across two JavaScript Application Graphs. It also separates itself from runtime tooling by stating it does not execute JavaScript, which distinguishes it from siblings like observe_javascript_runtime. The density of qualifiers ('authenticated', 'reciprocal unique literal discriminants') slows parsing, but the core operation is unambiguous.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the closing clause 'runtime behavior requires a separate agent-run probe' implicitly routes dynamic-behavior questions to a runtime sibling, and the unknown-coverage rules hint at when results are inconclusive. There is no explicit when-to-use/when-not framing and no comparison against the other compare_* siblings (compare_functions, compare_bundles) that an agent must choose between. An agent can infer the static-only niche but must do the routing work itself.

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

Deploy Server

Other Tools