Skip to main content
Glama
yesheng-oss

Context-MCP

by yesheng-oss

codegraph_context

Builds a bounded, token-budgeted code subgraph for AI coding tasks, tracing callers, dependencies, and imports within hop limits, then returns ranked nodes, paths, budget usage, and drop reasons.

Instructions

Build a bounded, token-budgeted context subgraph for an AI coding task. Finds query-matching seed nodes, expands callers/dependencies/imports up to max_hops, ranks candidates, and returns compact nodes, relationship paths, budget usage, candidate counts, and per-item drop reasons.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesProject root
top_kNoMaximum query seed nodes (default 5)
max_hopsNoMaximum graph expansion depth (default 2, max 5)
questionNoCurrent code task or architecture question
token_budgetNoMaximum approximate tokens for nodes and edges

Schema Changelog

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

  1. First observedv1.3.0

TDQS

A3.8/5.0
Behavior4/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 transparency. It does well by disclosing the algorithm (query matching, expansion by hops, ranking) and the return contents (compact nodes, relationship paths, budget usage, candidate counts, and per-item drop reasons). It does not explicitly state whether the tool mutates anything on disk, but the emphasis on 'returns' suggests a read/compute operation.

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?

The description is two sentences, front-loads the core purpose, and packs meaningful behavioral and output details without redundancy. Every clause adds information about what the tool does or returns.

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 there is no output schema, the description appropriately lists the major return categories: compact nodes, relationship paths, budget usage, candidate counts, and drop reasons. It is reasonably complete for a complex graph-traversal tool. The main gap is absence of preconditions or explicit guidance on how it relates to prerequisite steps like codegraph_build.

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 all five parameters. The description adds some contextual meaning by tying max_hops to expansion and token_budget to the bounded nature of the result, but it mostly restates concepts already present in the schema rather than providing substantial additional parameter-level detail.

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 clearly states what the tool does: builds a bounded, token-budgeted context subgraph for an AI coding task, with a detailed walkthrough of the process (seed nodes, expansion, ranking, results). It is specific about verb and resource, but it does not explicitly distinguish itself from sibling tools like codegraph_query or codegraph_nodes, so it misses the upper bar for sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'for an AI coding task' plus 'bounded, token-budgeted context subgraph' implies this should be used when the agent needs a compact, budget-limited view of relevant code relationships. However, it does not explicitly state when to prefer this over alternatives such as codegraph_query or codegraph_report, nor does it give any exclusions or prerequisites.

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

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/yesheng-oss/context-mcp-subgraph'

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