Skip to main content
Glama

Render (layout spec)

codetopo_render
Read-only

Render a code graph from an index database using a deterministic layered or force layout, with optional structure-only scope for focused diagrams.

Instructions

The graph's layout specification: 'layered' (layout spec v1, the default) or 'force' (Fruchterman-Reingold, layout spec v2 - deterministic, fixed parameters recorded in the spec). Above the force ceilings the answer is a stated decline naming the ceiling, not a partial drawing. The same spec objects serve the CLI's render command and the HTTP render route.

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": {
      "db_path": "<db_path>"
    },
    "name": "codetopo_render"
  }
}

Input Schema

NameRequiredDescriptionDefault
scopeNoWhich node universe to lay out: 'full' (default, every node) or 'structure' (structural kinds only — package/file/module/class/interface/doc — with symbols rolled up to their nearest structural ancestor; layered layout only). A structure answer records scope and the full graph's node count in the object.
layoutNoWhich layout to compute. Default: layered.
db_pathYesPath to the index database.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.0
    • addedInput schema / properties / scope
      Added value: +{
      +  "description": "Which node universe to lay out: 'full' (default, every node) or 'structure' (structural kinds only — package/file/module/class/interface/doc — with symbols rolled up to their nearest structural ancestor; layered layout only). A structure answer records scope and the full graph's node count in the object.",
      +  "enum": [
      +    "full",
      +    "structure"
      +  ],
      +  "type": "string"
      +}
  2. Addedv0.9.0

TDQS

B3.2/5.0
Behavior4/5

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

Annotations already cover the read-only, non-destructive, closed-world profile, so the bar is low, but the description adds genuine context: force layout is deterministic with fixed parameters recorded in the spec, and exceeding force ceilings yields a stated decline naming the ceiling rather than a partial drawing. That failure-mode disclosure is the kind of behavior an agent cannot get from structured fields.

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?

Three sentences with no filler, but ordering is backwards: it opens with enum enumeration rather than stating the tool's action, and the closing sentence about CLI/HTTP route reuse is only marginally relevant to tool selection. It reads as spec documentation pasted into a description.

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

Completeness3/5

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

For a 3-parameter read-only tool with an existing output schema absent, the description should say what comes back — a layout specification object, presumably including the recorded parameters. It hints at 'spec objects' and a declined answer but never describes the success payload, leaving the most important return-shape question unanswered.

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 baseline is 3, but the description adds real meaning for the layout parameter beyond the schema's 'Which layout to compute': it names the underlying algorithm, spec version, and determinism guarantee. The scope parameter gets no equivalent elaboration, so it stops short of a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description enumerates the two layout modes ('layered' spec v1, 'force' Fruchterman-Reingold v2) but never states the tool's action or deliverable — it never says whether it returns a layout spec object, coordinates, or rendered output. The verb is only implied by the title 'Render (layout spec)'. An agent can tell which modes exist but not confidently what calling it produces.

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

Usage Guidelines2/5

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

Only an implied default ('layered') is given; there is no guidance on when to pick force vs layered, no prerequisites, and no routing to any sibling tool (e.g. codetopo_snapshot or codetopo_metrics) for adjacent needs. The agent must infer selection criteria from the algorithm names alone.

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