Skip to main content
Glama
SK-DEV-AI

codesearch MCP Server

by SK-DEV-AI

code_read

Read a source file from an indexed npm, PyPI, or crates package using a package-scoped path, enabling dependency source inspection without cloning.

Instructions

Read a file from an indexed dependency by package-scoped path. PkgSeer + jsDelivr; indexes npm/pypi/crates ONLY (github: specs rejected). e.g. code_read(spec='npm:express', path='src/index.js')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path within the package (e.g. src/index.js)
specYesPackage spec: registry:name[@version] (e.g. npm:express)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description does carry real weight: it names the backing sources (PkgSeer + jsDelivr) and the supported registry allowlist, which explains why some specs fail. It does not say what is returned on a missing file, whether output is truncated, or confirm read-only/non-mutating behavior.

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?

Three short clauses, front-loaded with the core action, followed by the registry constraint and a runnable example. Dense and largely waste-free, though the 'PkgSeer + jsDelivr' fragment is jargon whose value to an agent is marginal.

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?

For a two-parameter read tool with full schema coverage and no output schema, the essentials are present: supported registries, path scoping, and a worked example. The remaining gap is return-value/error behavior, which is minor for a file-read operation but would help when a path or spec is invalid.

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 100%, so both parameters are already documented as 'registry:name[@version]' and 'file path within the package'. The description only reinforces this with a combined example call, adding little meaning beyond the schema — baseline 3 is appropriate.

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?

States a specific verb and resource ('Read a file from an indexed dependency') and scopes it with 'package-scoped path', plus a concrete call example. It does not explicitly contrast with the closest siblings (code_files, code_search, searchcode), so an agent must infer that this fetches one file's contents rather than listing or searching.

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?

Gives a hard exclusion — 'indexes npm/pypi/crates ONLY (github: specs rejected)' — which prevents a whole class of misuse. It stops short of naming an alternative for the rejected github case, leaving the agent to guess whether searchcode or docs should handle that.

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