Skip to main content
Glama

map_existing_codebase

Read-onlyIdempotent

Generate a legibility report for translating a Python codebase into a target language, with per-file translatability, construct counts, unmapped constructs, and coverage summary.

Instructions

Report what translating a codebase into a language would look like.

The legibility report: per-file translatability, construct counts, constructs the target language's pack cannot map yet (they stay English after translation), and an aggregate coverage summary. Orchestrates per-file translate + validate; for a large repo, iterate in batches of files across calls.

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": {
      "files": "<files>",
      "target_lang": "<target_lang>"
    },
    "name": "map_existing_codebase"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesFiles to map. Paths are report labels only — they are content, never logged, never used to touch the filesystem.
source_langNoISO 639 language code from the legesher://languages catalog.en
target_langYesISO 639 language code from the legesher://languages catalog.
python_versionNo3.13
include_translationsNoAlso return the translated files (default: report only).

Output Schema

NameRequiredDescriptionDefault
filesYes
summaryYes
source_langYes
target_langYes
python_versionYes
translated_filesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.24.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds real behavioral context beyond that: it orchestrates per-file translate + validate (implying cost), notes that unmappable constructs remain English in output, and advises batching across calls for large repos.

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?

The purpose is front-loaded in the first sentence and the report contents are itemized compactly. Some phrasing is slightly dense ('for a large repo, iterate in batches of files across calls'), but no sentence is wasted.

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 an output schema present, return values needn't be explained, and the description nonetheless summarizes what the report contains. Combined with the batching note and orchestration mention, an agent has enough to call it correctly, though explicit routing against the translate siblings would make it complete.

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 description coverage is 80%, so the schema already documents files, source_lang, target_lang, and include_translations. The description adds no further meaning to target_lang/source_lang beyond 'translating into a language', and only reinforces batching behavior rather than clarifying parameter values. Baseline 3 applies.

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 description gives a concrete verb+resource ('Report what translating a codebase into a language would look like') and enumerates the report's contents (per-file translatability, construct counts, unmappable constructs, coverage summary). It implicitly distinguishes itself from translate_to_native by being a report rather than a translation, though it never names a sibling explicitly.

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?

It gives one useful operational guideline — iterate in batches of files across calls for a large repo — but offers no explicit when-to-use/when-not guidance relative to translate_to_native or validate_identifier_translations. The choice between this tool and the translate siblings is only implied by the word 'report'.

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