Skip to main content
Glama
0xYubo
by 0xYubo

get_code_context

Read-only

Retrieve code context around specified file paths and line numbers to verify if a change affects them. Supports batch mode for checking multiple locations in one call.

Instructions

获取代码上下文,帮助判断命中处是否真正受变更影响。支持两种模式:单点(file_path + line_number)或批量(locations 数组,推荐——验证多个命中时一次调用替代多次往返)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNo单点模式:文件路径;可传扫描结果中的相对路径(需同时传 project_path)或绝对路径
locationsNo批量模式:[{file_path, line_number}] 数组,一次返回多段上下文
line_numberNo单点模式:目标行号(从 1 开始)
project_pathNo项目根目录绝对路径;file_path 为相对路径时必传
context_linesNo前后各显示行数,默认 6
Behavior3/5

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

The annotations declare readOnlyHint=true, so the read-only safety is already covered. The description adds behavioral context about the two modes (single vs. batch) and a recommendation, but does not disclose other behavioral traits like error handling, performance, or exact return format. This is adequate given the simple read-only nature.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the tool's purpose, and no wasted words. Every phrase adds value: the purpose, the two modes, and the batch recommendation.

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?

The description covers the primary usage and modes, and the annotation provides safety context. There is no output schema, so the description could ideally mention what the response includes, but the tool name and context_lines parameter imply code content around the specified lines. It is complete enough for a straightforward read-only utility.

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 coverage is 100%, so parameters are well-documented. The description adds value by clarifying the mode semantics (single vs. batch) and the recommendation to use batch mode, which goes beyond the schema's individual parameter descriptions. It also reinforces relative path handling with project_path.

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 uses a specific verb (获取) and resource (代码上下文), and clarifies its purpose: helping judge whether a code hit is truly affected by changes. It distinguishes from sibling tools by focusing on context retrieval for impact assessment, though it does not explicitly name alternatives.

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?

It clearly states when to use the tool (to verify if a hit is affected by changes) and recommends batch mode for multiple hits to reduce round trips. It gives context for both single and batch modes, though it lacks explicit exclusions or when-not-to-use guidance.

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/0xYubo/Ripple-Mcp'

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