Skip to main content
Glama

view_code_items

Retrieve full code definitions for known classes and methods, supporting interface-to-implementation traversal and field type inference for comparison and analysis.

Instructions

[Precise Code Retrieval] Best for cases where the file path and item name are known. Batch returns full definition blocks for classes/methods/functions. If the input is a Java interface and implementations exist, it will attempt to traverse to Impl classes and return same-named method snippets (multiple implementations are supported and labeled). It also parses fields referenced in the method snippet to infer their type-to-class paths. Ideal for interface/implementation comparison, fast location of key methods, and precise extraction before call-chain analysis; if the path or name is unknown, use file search tools first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ItemsYesList of code items to query.
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: batch processing, traversal to implementation classes for Java interfaces, support for multiple implementations with labeling, parsing of referenced fields to infer type-to-class paths, and specific use cases. It doesn't mention error handling or performance characteristics, keeping it from a perfect score.

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 and front-loaded with the core purpose in the first sentence. Every sentence adds value: the second explains advanced features, the third states ideal use cases and alternatives. Minor deduction for slightly dense phrasing in the middle sentence.

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's complexity (with traversal, parsing, and batch features), no annotations, and no output schema, the description does well to cover purpose, usage, and key behaviors. It could be more complete by hinting at return format or error cases, but it provides substantial context for effective use.

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 documents the single parameter 'Items' as an array of objects with 'File' and 'ItemName'. The description adds context about what constitutes valid inputs ('Absolute path', 'Exact name') and examples, but doesn't provide additional syntax or format details beyond what the schema implies. Baseline 3 is appropriate when schema does the heavy lifting.

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's purpose with specific verbs ('retrieval', 'returns', 'parses') and resources ('full definition blocks for classes/methods/functions', 'method snippets', 'fields referenced'). It distinguishes from siblings by specifying this is for 'precise retrieval' when file path and item name are known, unlike file search tools mentioned.

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 guidance on when to use ('Best for cases where the file path and item name are known', 'Ideal for interface/implementation comparison, fast location of key methods, and precise extraction before call-chain analysis') and when not to use ('if the path or name is unknown, use file search tools first'), including clear alternatives.

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/raintear94/code-search-mcp'

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