Skip to main content
Glama

flow_trace

Trace functions, classes, files, or state fields to map directed code relationships with source-line evidence and confidence before edits. Inspect branches, call paths, state reads/writes, and impact.

Instructions

【改代码前必调】输入任意函数名、类名、文件名或状态字段,透视带源码行号与置信度证据的有向关系(evidencedRelations:区分 CONTAINS / SEQ_CALL / BRANCH_DISPATCH / REGISTRATION / STATE_RW / IMPLEMENTS / PROTOCOL_BRIDGE)、同级条件分支与顺序职责步骤分离、入参消费矩阵、多态同族与归一化词法 Shingle 近似候选。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "target": "<target>"
    },
    "name": "flow_trace"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNo路径终点:唯一符号、精确节点 ID、文件或模块;与 target 组成有向路径查询
depthNo焦点周围关系跳数,默认 1;0 仅展示焦点范围
focusNo架构节点 ID、模块目录、文件路径或唯一符号名;可用返回的 drillDown 参数逐层展开
levelNo架构展开层级;overview 默认 module,trace 默认 symbol
edgeIdNo要获取完整证据的关系 ID,需使用返回该关系时的 level
impactNo返回焦点的上下游依赖影响;高置信路径与仅候选路径分列
targetYes要透视追踪的函数名、类名、状态字段名或文件名
taskIdNo同一会话内的任务隔离标识;也可通过 FLOWGUARD_TASK_ID 设置
maxHopsNo路径跳数上限,默认 12
maxEdgesNo最多返回关系数,默认 80;关系附证据和置信度
maxNodesNo最多返回节点数,默认 40
maxPathsNo返回最短简单路径数量上限,默认 5
pathModeNoexecution 默认只走调用/协议;relationships 包含注册、状态、结构和依赖
directionNo架构邻域查询方向,默认 both;不代表运行时可达性
edgeScopeNoall-matched 可独立遍历全部匹配关系;页外端点返回 boundaryNodes
maxOwnersNo每个状态最多返回的写入方/读取方,默认 30
maxStatesNo状态查询最多返回数,默认 20
sessionIdNo会话隔离标识;也可通过 FLOWGUARD_SESSION_ID 设置
edgeOffsetNo当前节点页内的关系分页偏移量,默认 0;改变节点页后应重置
nodeOffsetNo稳定节点分页偏移量,默认 0;完整计数及省略量见 architecture.coverage
impactLimitNo每方向每类影响结果的上限,默认 100
maxEvidenceNo单次关系证据上限,默认 50
projectModeNo覆盖工程模式判定(默认 auto)
stateOffsetNo状态查询分页偏移量
inspectStateNo将 target 作为精确状态字段/限定名查询写读所有者与持久化线索
searchBudgetNo路径搜索状态预算,默认 20000;截断会明确返回
maxCandidatesNo完整证据单页候选数,默认 20;预览最多 8 个
workspaceRootNo代码仓库根目录绝对路径
evidenceOffsetNo关系证据分页偏移量
candidateOffsetNo完整关系证据中的候选分页偏移量
expectedGraphIdNo翻页时传回 graphId,源码/配置/图变化时拒绝混用
includeTopologyNo返回全投影的依赖环、孤立节点和枢纽;不受 focus/分页截断
includeCandidatesNo路径是否包含候选边,默认 false

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose that results include source line numbers, confidence evidence, explicit relation categories (CONTAINS, SEQ_CALL, BRANCH_DISPATCH, REGISTRATION, STATE_RW, IMPLEMENTS, PROTOCOL_BRIDGE), branch/step separation, a parameter consumption matrix, and approximate candidates. It stops short of stating read-only behavior, performance characteristics, or whether any repository state is modified.

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

Conciseness3/5

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

The description is a single dense sentence front-loaded with a useful directive, but the long Chinese clause packed with parenthetical enumerations makes it hard to parse quickly. It avoids repetition but sacrifices structure and readability for compression.

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 33 parameters and no output schema, the description gives a reasonable high-level sketch of returned artifacts and relation types, but it leaves significant gaps around paging semantics, multi-mode behavior, and how the many parameters interact. The 100% schema coverage mitigates the parameter gap, but the overall behavioral picture is only partially complete.

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 input schema already documents all 33 parameters, making 3 the baseline. The description clarifies accepted target kinds (function, class, file, state field) and some output concepts, but it does not add meaning beyond the schema for the numerous paging, direction, and budget parameters.

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 states a specific action ('透视追踪' / trace through) and resource (any function, class, file, or state field) along with the kinds of relationships returned. It does not mention sibling tools like flow_blueprint or flow_overview, so an agent cannot distinguish this from those alternatives based on the text alone.

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 bracketed directive '改代码前必调' (must call before changing code) gives a clear trigger condition, but there is no when-not guidance and no comparison to sibling tools. The agent must infer whether flow_overview or flow_blueprint would be more appropriate for a given situation.

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

Deploy Server

Other Tools