Skip to main content
Glama
Sunye1213106

ascendc-codemap-mcp

by Sunye1213106

AscendC CodeMap MCP

AscendC CodeMap MCP:提取与查询框架

按 operator + architecture 编译得到的、自包含 AscendC 语义索引。构建把 C++ / CANN DSL 编成唯一、可信、可追溯的语义事实;.uo 是唯一产品真值;Query 把这些事实压缩成面向 AI 的上下文。Agent 只负责理解任务和使用事实。

架构合约见 docs/ARCHITECTURE.md。两条根约束:Build for truth. Project for usefulness. Query 是 semantic projection / compression,不重新分析代码,也不读工作区源码。内部 identity(entity id、USR、provenance)默认不出现在 Agent 卡片上。

这不是通用代码记忆。Agent 的计划、review、ADR 留在会话或调用方(例如 AscendC-Pilot)。

对 SFAG 算子的本地实测:

操作

耗时

首次构建 CodeMap

约 1 分钟

单次查询

约 20 ms

一次构建,之后反复查询,避免每次重新 grep 和通读源码。

构建需要 CANN Toolkit 头文件和 LLVM clang。查询已有 .uo 不依赖 CANN。环境不会自动配好:先 codemap_doctor,按 next_steps 下载 .run 并用 cann-extract 解包。

它解决什么

AscendC 算子逻辑通常跨多层传递:

Host → TilingData → TilingKey / Template → Kernel → AscendC API

Kernel 里看到的行为,往往由 Host 条件决定,再经 TilingData、TilingKey 和模板参数一路传下来。普通搜索能回答「这个名字出现在哪」,很难直接回答:

  • 谁写入了这个 TilingData 字段?哪个 Kernel 读取了它?

  • 哪条 TilingKey / Template 控制这条路径?某个模板组合是否合法?

  • 这段 Kernel 最终落到哪个 AscendC API?

  • Buffer、Queue、Pipe、Event 之间是什么关系?

CodeMap 把这些关系提前提取进图,让 agent 按标识符、Dim、证据位点查询。

Related MCP server: Lore MCP Server

和 Codebase Memory / CodeGraph

Codebase Memory 与 CodeGraph 是通用代码图:多语言、通用导航。CodeMap 只做 AscendC 算子领域语义

Codebase Memory / CodeGraph

AscendC CodeMap

目标

通用代码理解

AscendC 算子理解

解析

主要 Tree-sitter

Clang + CANN 编译上下文

语言

多语言

C++ / AscendC

Call graph

Template 语义

通用

重点建模

TilingData / TilingKey

Host → Kernel 数据流

Buffer / Queue / Pipe / Event

Architecture / 编译条件

通用

按 arch 产品槽

他们更擅长「代码在哪、谁调用谁」。CodeMap 更希望回答:这个算子为什么走到这个 Kernel,以及这个值怎么从 Host 传下来。

本仓库不把 memory / ADR / 文档检索、默认 Cypher/SQL 或可视化做成产品功能。impact 仍是 codemap_query 的一个 operation,会等 resolve dossier 覆盖后再从公开 enum 删除。

为什么用 Clang

Tree-sitter 适合快速、多语言的语法树。AscendC 大量依赖 C++ 编译语义,例如:

template <bool IsPse, typename T>
__aicore__ inline void Process(...)

只看语法很难完整恢复模板参数与实例化、类型、宏、architecture 分支、Host 字段写入、TilingKey 选择和 Kernel specialization。因此构建路径是 libclang + 实际 CANN 环境,再叠加 AscendC 专用分析。

当前建模的语义

Host / Tiling: Function、Method、Branch、Predicate、Input、Output、TilingData、Field、Host READ/WRITE、Compile Macro / Variable。

Template / TilingKey: TilingKey、Template、Template Argument / Instance、Build Variant、Binding / Specialization / Selection。

Kernel: Kernel、Operation、Buffer、Register、Queue、Pipe、Event、AscendC API。

边上常见:

READS / WRITES    CALLS    BINDS    SELECTS    LAUNCHES
GUARDED_BY        FLOWS_TO    SAVES / RESTORES    SIGNALS / AWAITS

串起来仍是:Host 条件 → TilingData 字段 → TilingKey / Template → Kernel → AscendC API。

身份与新鲜度

索引之后用稳定 id,不要每次贴绝对路径:

codemap_id   = p:<workspace>::op_name@arch     例如 p:a91f42::flash_attention_score_grad@arch35
alias        = op_name@arch                    本进程内唯一时可用;撞车返回 AMBIGUOUS_CODEMAP_ID
snapshot_id  = cm:<digest 前缀>                已提交图的内容身份,不是 path/mtime

codemap_status 看的是相对当前源码的 freshness,不是「磁盘上有没有 .uo」:

fresh / dirty / stale / building / blocked / incompatible / unknown

读写契约:

  • ok 只表示这次调用在协议层成功。更新是否发生看 stateupdated

  • codemap_update 得到 state=needs_confirmation 时图没有前进,需用户确认后再 confirm_scope=true

  • 已有 .uo 时再调 codemap_indexALREADY_INDEXEDupdated=false),应改用 codemap_update

  • 正在构建时,查询返回 freshness=building,不会读半写文件。

构建环境(Clang + CANN)

查询已有 .uo 不需要 CANN / Clang。冷构建(codemap_index)需要三者齐备:

  1. Python ≥ 3.10 与本仓库(pip install -e .

  2. LLVM 18 clang 可执行文件 + pip libclang(只有 Python 绑定不够,TPL 预处理要跑 clang -E

  3. CANN Toolkit 头文件(解包 .run 即可,不必在本机完整安装 Toolkit,也不需要 NPU)

Agent 先跑 doctor,再按返回的 next_steps 配环境,不要猜路径:

pip install -e .
python -m ascendc_codemap_mcp doctor --project <算子目录> --architecture arch35

ok=false 时执行 next_steps,再跑一次 doctor。不要执行 .run 安装脚本。

Clang / libclang

Ubuntu / Debian:

sudo apt-get update
sudo apt-get install -y clang
python -c "import clang.cindex as c; print(c.__file__)"
clang --version

Windows(LLVM 18 与 pip libclang 18.x 对齐):

winget install --id LLVM.LLVM --version 18.1.8 -e
python -c "import clang.cindex as c; print(c.__file__)"
clang --version

clang 不在 PATH 时:

$env:CLANG_EXE = "C:\Program Files\LLVM\bin\clang.exe"

也可设 UO_CLANG / LLVM_HOME

下载 CANN Toolkit .run

CodeMap 只要 Toolkit 开发套件里的头文件。不要下 kernels / nnal 来代替 Toolkit。

  1. 先搜本机,避免重复下载(包很大):

Get-ChildItem -Path "$HOME\Downloads","D:\Downloads","$HOME" -Filter "Ascend-cann-toolkit_*.run" -ErrorAction SilentlyContinue
ls ~/Downloads/Ascend-cann-toolkit_*.run 2>/dev/null
  1. 没有文件时,打开昇腾社区下载中心(需要华为账号登录;社区包的直链通常带签名,未登录 wget 会失败):

  1. 页面上选 CANN Toolkit,操作系统 Linux,架构:

本机

下载哪个 .run

Windows / Linux x86_64

Ascend-cann-toolkit_<version>_linux-x86_64.run

Linux aarch64

Ascend-cann-toolkit_<version>_linux-aarch64.run

Windows 也下 linux-x86_64 包:cann-extract 只解出文件树,不会执行 installer。

版本尽量与算子真实编译环境一致。部分社区版安装文档会给出 ascend-repo.obs.cn-east-2.myhuaweicloud.com 的 wget;仅当该版本文档写明 URL 时再用,不要随便抓一个旧包。

已有官方安装(source set_env.sh)则把 ASCEND_HOME_PATH 指到安装前缀,不必再解 .run

解包 CANN(不要跑 installer)

推荐解到本仓库 _cann/pkg,doctor 会自动发现,不必设环境变量:

$pkg = Join-Path (Get-Location) "_cann\pkg"
python -m ascendc_codemap_mcp cann-extract `
  "D:\Downloads\Ascend-cann-toolkit_<version>_linux-x86_64.run" `
  --dest $pkg
python -m ascendc_codemap_mcp cann-extract --fixup --dest $pkg

Linux:

pkg="$(pwd)/_cann/pkg"
python -m ascendc_codemap_mcp cann-extract \
  ~/Downloads/Ascend-cann-toolkit_<version>_linux-x86_64.run \
  --dest "$pkg"
python -m ascendc_codemap_mcp cann-extract --fixup --dest "$pkg"

等价写法:python scripts/cann_extract.py ...(checkout 内、尚未 pip install 时)。

解完应能看到:

_cann/pkg/
├── cann-metadef/
├── cann-asc-devkit/
├── cann-opbase/
├── cann-npu-runtime/
├── cann-ge-compiler/
└── bisheng/          # 若包内有

ASCENDC_CODEMAP_CANN_ROOT 指 package (上面这一层),不要指到某个 include/。解到别处时设用户级环境变量,只写当前会话会丢。

Windows:

[Environment]::SetEnvironmentVariable("ASCENDC_CODEMAP_CANN_ROOT", "<abs-pkg>", "User")

Linux:

echo 'export ASCENDC_CODEMAP_CANN_ROOT=/abs/path/to/_cann/pkg' >> ~/.bashrc

--fixup 会补 asc/impl/includeasc/include(官方包不带这个目录,vanilla clang 需要这个 junction)。

安装 MCP

pip install -e .
python -m ascendc_codemap_mcp doctor --project <算子目录> --architecture arch35
python -m ascendc_codemap_mcp install

Windows:

pip install -e .
python -m ascendc_codemap_mcp install

install 为已检测到的客户端写入本产品的 MCP 条目和 skills,不改无关 server、不打开 YOLO。uninstall 只删除本产品写入的内容。装完后重启 coding agent。工具出现在 MCP server ascendc-codemap-mcp

协议是官方 Python SDK 的 2026-07-28(含 stateless server/discover),同一进程仍服务握手期客户端。

不要在 MCP 连接时自动 index。冷构建可能要几分钟。

构建与更新

ascendc-codemap-mcp index --project <算子目录> --architecture arch35

产物:

<operator>/.ascendc-codemap/<arch>/<op>.<arch>.uo

源码变化后增量刷新(优先 codemap_id):

ascendc-codemap-mcp update --codemap-id <id>
ascendc-codemap-mcp status --codemap-id <id>

index 在 prepare / extract / analyze / commit 之间可取消。update 在 detect / plan / 各层 rebuild / commit 之间可取消。某一步内部的 Clang 会跑完该步。取消是每次调用一份 token,不是按 CodeMap 共享。

查询

Query 只读已提交的 .uosource_line / 图),不打开工作区文件。不知道 ident 时先 search,知道了再 resolve

CLI:

ascendc-codemap-mcp discover --project <算子目录>
ascendc-codemap-mcp query --codemap-id <id> --symbol IsPse
ascendc-codemap-mcp query --codemap-id <id> --operation search --name BufferNum
ascendc-codemap-mcp query --codemap-id <id> --operation find --kind OPERATION --callee SyncAll

Agent 用 typed 工具。operation 是闭集 enum,缺省 resolvesymbol 必须是一个标识符;自然语言句子返回 INVALID_QUERY(合法 filter 清单 + 已解析 token),不会模糊排名。

意图

工具

扫目录、拿到 codemap.id

codemap_discover

新鲜度

codemap://map/{codemap_id}(CLI 仍可用 status

图查询(ident / Dim / 集合)

codemap_queryoperation + 闭集 filters)

从卡片继续

codemap_evidenceevidence_id + expected_snapshot_id

构建前检查

codemap_doctor

冷构建

codemap_index

增量刷新

codemap_update

codemap_queryoperationresolve(缺省) / search(源码行) / find(集合) / trace(A→B)。contract / impact / entry 仍可用,优先走 resolve。Dim 用 dim + value,不要写 Dim= 字符串。兼容别名:index_operatorupdate_operator。只读工具带 readOnlyHint。查询结果走统一 envelope(okcodemapverdictlayerdataevidencecoveragenext_cursor)和 structuredContent

evidence[].idspan:...)走,并把当时的 snapshot_id 当作 expected_snapshot_id;对不上是 SNAPSHOT_CHANGEDcoverage.truncated 且带了 next_cursor 再翻页。count: 0 不等于「图上没有」,跟 hint

回答所问的层:Host 写出 ≠ 模板可编译 ≠ Kernel 消费。不要把 LLM 补丁写进 .uo,不要对产品图跑原始 SQL/Cypher。

资源与传输

类型

名称

URI / 参数

Resource

runtime

codemap://runtime

Resource template

一张图的身份与新鲜度

codemap://map/{codemap_id}

Prompt

query_operator

codemap_id,可选 focus

Prompt

build_codemap

projectarchitecture

codemap_id / architecture 的补全来自本进程 registry 和常见 arch 名。

默认 stdio。同一 SDK server 也可 HTTP(这是传输,不是远程图服务):

ascendc-codemap-mcp serve --transport streamable-http --host 127.0.0.1 --port 8765

install 覆盖 Cursor、Claude Code、Codex、OpenCode。Cursor / Claude Code 只写 skills;Codex / OpenCode 另写 AGENTS.md 片段。

环境变量

变量

作用

ASCENDC_CODEMAP_CANN_ROOT

解包后的 CANN 根(还可回退 ASCEND_CANN_PACKAGE_PATHASCEND_HOME_PATHCANN_ROOT)。解到 <checkout>/_cann/pkg 时不必设

CLANG_EXE / UO_CLANG / LLVM_HOME

clang 可执行文件;仅 pip libclang 不够

ASCENDC_CODEMAP_CACHE_DIR

缓存目录,默认 ~/.cache/ascendc-codemap-mcp

ASCENDC_CODEMAP_PROJECT / ASCENDC_CODEMAP_ARCHITECTURE

本进程 discover 之后的默认身份;也作 CLI 默认

ASCENDC_CODEMAP_MAX_OPEN

打开的查询句柄 LRU 上限,默认 4

Codex 子进程只转发 env_vars 里列出的名字;install 会带上 CANN / cache 相关变量。

Windows 可以解 linux-x86_64 .run 再构建;查询已有 .uo 不依赖 CANN。

License

MIT

Available Tools

5 tools
codemap_doctorcodemap_doctorA

Check whether this machine can build an AscendC operator CodeMap: CANN headers, libclang, operator directory, and architecture.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectNoOperator directory (absolute path).
architectureNoe.g. arch35. Required for index paths.

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the phrase 'Check whether' credibly signals a non-mutating diagnostic and the colon list reveals exactly what environment conditions are inspected. It does not spell out the result format or whether the check can have side effects, but the core behavior is transparent.

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?

A single sentence states the purpose before a colon-delimited list of dependencies. There is no filler or duplication of the schema; every phrase earns its place.

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?

For a low-complexity diagnostic with 100% schema coverage, the description gives an agent enough to select and call it correctly. The main gap is the absence of an output schema or a stated return shape (e.g., boolean vs. detailed report), but the core invocation context is 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 coverage is 100%, so the parameters are already documented. The description adds context by confirming that 'project' is the operator directory and architecture is one of the checked conditions, but it does not add new syntax or semantics beyond the schema.

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 names a specific action ('Check whether this machine can build an AscendC operator CodeMap') and a concrete resource, with an explicit list of checked prerequisites (CANN headers, libclang, operator directory, architecture). This clearly distinguishes a preflight diagnostic from the sibling index/update/query tools.

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 use case is implied: call this when you need to know whether the machine is ready to build a CodeMap before running a build or index operation. However, it does not explicitly name alternatives or say when not to use it, leaving some routing to inference.

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

codemap_statuscodemap_statusA

Whether a committed .uo CodeMap exists for this operator + architecture, plus mtime and completeness.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectYes
architectureYes

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral disclosure burden, and it does partially by clarifying that the tool reports existence, mtime, and completeness rather than returning CodeMap content. It does not state whether the operation is read-only, what happens when the CodeMap is missing, or any authentication or error behavior. This is adequate for a likely innocuous status check but leaves gaps around edge-case behavior.

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 a single sentence that packs the resource, the condition (committed), the parameters (operator + architecture), and the returned attributes (existence, mtime, completeness) with no wasted words. Everything present is informative and directly relevant.

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?

Given the simple two-parameter schema and no output schema, the description provides the core return semantics, but it does not describe the response shape, success/failure indicators, or behavior when no committed CodeMap exists. It is functionally complete for a basic status check but could benefit from a note on the return format.

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 0%, so the description must compensate. It does so by mapping the two parameters to 'this operator + architecture', indicating that 'project' likely refers to an operator and 'architecture' to an architecture. It does not define valid values, formats, or the relationship between the fields, leaving some ambiguity.

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 clear, specific purpose: it checks whether a committed .uo CodeMap exists for a given operator and architecture, and reports mtime and completeness. It is not a tautology and goes beyond the name by naming the exact resource and attributes. However, it does not explicitly contrast itself with siblings like query_codemap or codemap_doctor, so differentiation is implied rather than stated.

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 wording 'Whether a committed .uo CodeMap exists' implies an agent should use this tool to check existence/status, but there is no explicit guidance on when to reach for it instead of query_codemap or codemap_doctor. It lacks any mention of preconditions, alternatives, or exclusions, so the agent must infer usage from context.

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

index_operatorindex_operatorA

Build or rebuild the operator CodeMap (prepare → extract → analyze → commit). Requires project + architecture. Do not call on MCP connect; only when the user asks to index or no .uo exists. If a .uo already exists, use update_operator instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectYesOperator directory (absolute path).
architectureYese.g. arch35.

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are present, so the description carries the burden. It explains the pipeline stages and the rebuild behavior, implying a mutating operation. It also warns against calling on MCP connect. However, it doesn't explicitly state side effects like overwriting an existing .uo or the nature of the output, which would add more transparency.

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 deliver the purpose, pipeline, preconditions, and alternative routing without fluff. Critical usage constraints are front-loaded and every word earns its place.

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 only two required params and no output schema, the description covers the main decision points well: what the tool does, when to call it, and when not to. Minor gaps remain around post-conditions (e.g., what a successful run produces) and whether 'rebuild' is destructive, but these are not critical for a tool with such strong usage guidance.

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 both parameters are already documented with types and descriptions. The description only restates that project and architecture are required, adding no additional semantic detail beyond the schema.

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 action: 'Build or rebuild the operator CodeMap' with a pipeline (prepare → extract → analyze → commit). It distinguishes itself from sibling update_operator by explicitly stating when to use that alternative instead.

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 gives explicit conditions for use: 'only when the user asks to index or no .uo exists' and 'Do not call on MCP connect.' It also names the alternative (update_operator) for the opposite case, leaving no ambiguity.

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

query_codemapquery_codemapA

Read-only operator CodeMap query. Four shapes only: (1) no pattern = index, (2) identifier e.g. IsPse, (3) Dim=Name or Name=Value e.g. IsPse=1, (4) file + line copied from a previous card. Do not pass natural-language sentences.

ParametersJSON Schema
NameRequiredDescriptionDefault
fileNoRelative path copied from a previous card.
lineNo
patternNoIdentifier, Dim=Name, or Name=Value. Omit for index.
projectNoOperator directory.
line_endNo
architectureNoe.g. arch35. Required.

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure and does state that the tool is read-only and accepts only four shapes. It does not cover invalid-input outcomes or authentication expectations, but the main safety-relevant behavior is clearly disclosed.

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 compact and front-loaded with the read-only nature and allowed shapes. Every sentence adds a useful constraint or clarification, with no filler.

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?

The description covers the main query patterns but leaves line_end undefined, does not explain project/architecture usage, and the schema's 'Required.' note on architecture conflicts with the declared zero required parameters. An agent can use the main forms but may be uncertain about combinations and output behavior.

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?

The description adds meaningful semantics beyond the schema by explaining pattern syntax, the file+line combination, and the omission rule for the index case. It does not describe line_end or clarify the requiredness of architecture and project, but the core query semantics are well covered.

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 states a specific read-only query operation on the operator CodeMap and enumerates the four accepted input shapes. The read-only qualifier sharply differentiates it from mutation siblings like update_operator.

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 gives explicit valid invocation forms and explicitly says not to pass natural-language sentences. It does not name alternative tools for other use cases, but the context is clear enough for an agent to know how to use this tool.

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

update_operatorupdate_operatorA

Incrementally refresh an existing CodeMap after source changes (detect → plan → rebuild changed layers). Requires an existing .uo. Do not call on MCP connect. Use index_operator only when no .uo exists.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectYesOperator directory (absolute path).
architectureYese.g. arch35.
confirm_scopeNoProceed when the plan asks for scope confirmation.

TDQS

A4.4/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. It discloses that this is an incremental rebuild of changed layers, that an existing .uo is required, and that it must not be called on MCP connect. It does not detail side effects or reversibility, but provides substantial behavioral context beyond a bare 'update' label.

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?

Three concise, purposeful sentences. The core purpose is front-loaded, followed by two essential constraints and a clear pointer to the alternative tool. No wasted words.

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?

For a mutation tool with no output schema, the description covers prerequisites and usage boundaries well. However, it does not describe the return value or outcome of the plan/confirmation flow, and it doesn't state what happens if confirm_scope is false. This leaves a small but meaningful gap.

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 all three parameters (project, architecture, confirm_scope) are already documented in the schema. The description adds no extra parameter-level meaning, so the baseline 3 applies.

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 states a specific verb and resource: 'incrementally refresh an existing CodeMap', and explains the internal pipeline (detect → plan → rebuild changed layers). It clearly distinguishes itself from index_operator ('only when no .uo exists'), leaving no ambiguity about what the tool does.

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?

It explicitly states when to use the tool ('Requires an existing .uo'), when not to use it ('Do not call on MCP connect'), and names the alternative: 'Use index_operator only when no .uo exists.' This is direct and actionable guidance.

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

TDQS

A4/5.0
Disambiguation5/5

Each tool maps to a distinct action: environment check, full build, incremental update, status check, and read-only query. The overlapping index/update pair is explicitly disambiguated by whether a .uo already exists.

Naming Consistency3/5

The names are readable and domain-consistent, but they do not follow one pattern: codemap_doctor/codemap_status use noun-first style, query_codemap is verb-first, and index_operator/update_operator use _operator suffix. This makes the naming less predictable across the set.

Tool Count5/5

Five tools is well-scoped for an operator CodeMap lifecycle: preflight, full index, incremental update, status, and query. No tool feels redundant at this granularity.

Completeness4/5

The surface covers the core lifecycle: build/rebuild, update, status, and query, plus environment validation. An explicit delete/cleanup tool is absent, but rebuild and update cover most recovery workflows.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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/Sunye1213106/ascendc-codemap-mcp'

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