Skip to main content
Glama

get_code_samples

Preview key source files from a codebase to understand project structure, including entry points, configuration, frequently modified files, and test examples.

Instructions

Get previews (first ~60 lines) of representative source files from the codebase. Includes entry points, config files, hot files (frequently changed), test examples, and one file per directory for breadth. Read files natively for full content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirYesAbsolute path to the project root directory
countNoMaximum number of files to sample (default: 15)
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes key behavioral traits: it reads files (implied read-only operation), provides previews limited to ~60 lines, samples multiple file types, and has a sampling approach. However, it doesn't disclose potential limitations like file size constraints, error handling, performance characteristics, or what happens with inaccessible files.

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 appropriately sized at two sentences. The first sentence efficiently conveys the core purpose and scope, while the second adds important behavioral context about file reading. There's minimal redundancy, though the phrase 'Read files natively for full content' could be slightly more precise about the relationship between previews and full content access.

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 tool with 2 parameters, 100% schema coverage, no annotations, and no output schema, the description provides adequate but incomplete context. It explains what the tool does and its sampling approach well, but doesn't describe the return format (what the previews look like structurally), error conditions, or how the sampling algorithm works in practice. The lack of output schema means the description should ideally cover return values more explicitly.

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 the schema already fully documents both parameters. The description doesn't add any parameter-specific information beyond what's in the schema. It mentions the sampling approach and file types, but this doesn't directly enhance understanding of the 'dir' or 'count' parameters beyond their schema definitions.

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 specific action ('Get previews'), resource ('representative source files from the codebase'), and scope ('first ~60 lines'). It distinguishes from potential siblings by specifying it provides previews rather than full analysis or snapshots, with explicit mention of what types of files are included (entry points, config files, hot files, test examples, directory breadth).

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?

The description provides clear context for when to use this tool: to get previews of representative files for an overview of the codebase. It mentions reading files natively for full content, implying this is for quick sampling rather than deep analysis. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/adrianczuczka/mason'

If you have feedback or need assistance with the MCP directory API, please join our Discord server