Skip to main content
Glama

Read Code

read_code
Read-onlyIdempotent

Read a known symbol or file from the user's project without dumping the whole tree. AST extract — signature plus body — cheaper than opening a 2,000-line file. ALWAYS call when find_code just returned a name or path, when the user named a function to inspect, or before you edit a large file. If they named Zephex or MCP and asked you to open or explain a function, this is the tool. Prefer this over native Read on files over ~50 lines. mode=symbol — extract by name (target or targets[]). mode=file — batch 1–20 paths. mode=outline — table of contents + plain-English overview before drilling a 300+ line file. mode=scan/smell — keywords or bug smells across files[] you already have. Works on any local project on their machine. Local/stdio: omit path to use editor cwd, or pass path as their project folder. No disk: inline_files. Call-graph modes (callers, blast_radius, dead_code) need local disk only. Returns summary, data.symbols or data.files, next_calls. Follow next_calls if truncated. Not for unknown location (find_code first). Not for stack/scripts (get_project_context). Example: read_code({ mode: "symbol", target: "validateToken" }) or read_code({ mode: "outline", files: ["src/auth.ts"] }). After find_code, do not re-search — pass the symbol as target or the path in files[]. detail_level=signature is enough to decide; body when you will edit. compact:true drops line numbers. Batch files[] instead of opening one path at a time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoWith mode:symbol. Filter to one symbol kind — disambiguate class vs method with same name.
modeNosymbol=AST extract by name (default). file=batch read files[] (all paths return). outline=file TOC. scan=keyword/pattern hits across files[] (use target or targets). smell=bug-pattern pass on files[] (empty catch, TODO, secrets). callers|blast_radius|dead_code=call graph (local path only).
pathNoThe user's project folder. Local/stdio: omit to use editor cwd, or pass the absolute folder. Hosted with no disk: use inline_files. Pair files[] from find_code.
filesNoWith mode:file|outline. Relative paths — from find_code hits. File mode: every path returns in one call (truncated per file if large, never dropped).
targetNomode:symbol|callers|blast_radius — symbol name (fuzzy). mode:scan — keyword or regex to find across files[].
compactNoWith mode:file|symbol. true = omit line numbers to save tokens.
targetsNomode:symbol — batch symbol names (max 8, set max_results:10). mode:scan — multiple keywords in one pass across files[].
symbol_idNoWith mode:symbol. Direct lookup ID from a prior hit (e.g. src/auth.ts::validateUser#function). Skips fuzzy search.
max_tokensNoResponse size cap (default 2000, max 8000). File batch auto-shares across paths. Lower only if context is tight.
session_idNoDedup across turns — symbols already returned get a stub with symbol_id instead of full body.
limit_linesNoWith mode:file. Max lines per file. Default: budget-based; set for pagination slices.
max_resultsNomode:symbol — max symbols (default 3, max 10). mode:scan|smell — max hits returned (default 30, max 100).
offset_lineNoWith mode:file. Start line (1-indexed). Use after batch read when data.hint says truncated.
context_pathNoWith mode:symbol. File path hint for ranking (e.g. src/auth.ts when repo has many auth symbols).
detail_levelNoWith mode:symbol. signature=~100 tokens. body=full implementation (default). context=body+imports.
inline_filesNoWhen path disk is unavailable: {"src/auth.ts": ""}. Hosted/private transport fallback.
confidence_thresholdNoWith mode:symbol. Min match confidence 0–1 (default 0.5). Raise 0.8 for exact; lower 0.3 to explore.

Schema Changelog

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

  1. Changed1 schema field changed
    • changedInput schema / properties / path / description
      Previous value: -"Project root. Stdio MCP: absolute path to the directory on disk. Hosted transport without local disk: use inline_files instead. Pair files[] paths from find_code."New value: +"The user's project folder. Local/stdio: omit to use editor cwd, or pass the absolute folder. Hosted with no disk: use inline_files. Pair files[] from find_code."
  2. Changed1 schema field changed
    • changedInput schema / properties / path / description
      Previous value: -"Project root. Local MCP: absolute path. Hosted MCP: public GitHub/GitLab URL. Pair with files[] from find_code."New value: +"Project root. Stdio MCP: absolute path to the directory on disk. Hosted transport without local disk: use inline_files instead. Pair files[] paths from find_code."
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, indicating a safe read operation. The description adds substantial behavioral context: it explains the AST extraction approach cost vs whole-file reads, that it returns summary with data.symbols/data.files and next_calls for pagination, and how modes affect behavior (e.g., file mode returns all paths, symbol mode uses fuzzy search). It also notes constraints like local disk requirements for call graph modes and path fallback for hosted transport. No contradictions with annotations.

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 description is long but every sentence earns its place given the tool's complexity (17 parameters, 8 modes). It is front-loaded with the essential purpose and immediate usage rule, then systematically covers each mode. While it could be slightly tighter, the density of actionable information justifies the length. Structure with mode labels and bullet-tips is effective.

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?

Given the tool has many modes, 17 parameters, and no output schema, the description provides a thorough overview. It explains what is returned (summary, data.symbols/files, next_calls), truncation behavior, and successfully bridges the gap between parameters and real usage. It covers edge cases like missing disk (inline_files) and pagination (offset_line, session_id). Minor gaps: the exact shape of symbol/file objects in the output is not detailed, but the description does reference prior hits and stubs to indicate reuse.

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 description coverage is 100%, so each parameter already has a description. However, the tool description adds strategic value beyond the schema: it explains the interplay between modes and parameters (e.g., 'detail_level=signature is enough to decide; body when you will edit', 'compact:true drops line numbers', 'batch files[] instead of opening one path at a time'). It also provides usage patterns like 'After find_code, do not re-search — pass the symbol as target or the path in files[].' This high-level guidance is not inferable from the schema alone.

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 clearly states the tool reads a known symbol or file from the user's project without dumping the whole tree, using AST extraction. It distinguishes from siblings by explicitly telling when to prefer this over native Read (files over ~50 lines) and when to use find_code first or get_project_context instead. The verb 'Read' and resource 'symbol or file' are specific, and the many modes are well-scoped.

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 description provides explicit when-to-use guidance: 'ALWAYS call when find_code just returned a name or path, when the user named a function to inspect, or before you edit a large file.' It also says when not to use: 'Not for unknown location (find_code first). Not for stack/scripts (get_project_context).' It names alternatives (find_code, get_project_context) and gives concrete examples for different modes. This is exceptional usage direction.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool targets a distinct domain: URL auditing, package checking, tests, architecture, code search, project context, planning, memory, code reading, and expert guides. Descriptions are extremely detailed and explicitly state when not to use each tool, leaving no ambiguity.

Naming Consistency4/5

Most tools follow the verb_noun snake_case pattern (audit_headers, check_package, check_test, explain_architecture, find_code, get_project_context, read_code), but project_memory (noun_noun) and Zephex_dev_info (brand_noun) deviate, and keep_thinking uses a gerund instead of a noun. The pattern is strong but not perfectly uniform.

Tool Count5/5

10 tools is well-scoped for a comprehensive development assistant. Each tool serves a clear purpose without redundancy, covering security, package management, testing, code understanding, project context, planning, memory, and expert knowledge. The count is neither too few nor excessive.

Completeness4/5

The tool surface covers a wide range of development analysis tasks: security auditing, package checking, test running, architecture mapping, code search, project context, planning, memory, code reading, and developer guides. Minor gaps include the lack of direct code editing or project execution/build tools, but the server appears intentionally focused on read-only information and planning.

Resources