Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add echoVic/blade-code --skill tool-contracts-and-registrygit clone --depth 1 https://github.com/echoVic/blade-codeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/echovic/blade-code/tool-contracts-and-registry)<a href="https://agentmods.dev/skills/echovic/blade-code/tool-contracts-and-registry"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/tool-contracts-and-registry/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/echovic/blade-code/tool-contracts-and-registry"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/tool-contracts-and-registry.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00156 | $0.02651 |
| Opus 5.5 | $0.00062 | $0.01060 |
| Sonnet 5.5 | $0.00031 | $0.00530 |
| Haiku 4.5 | $0.00016 | $0.00265 |
Grade A, and why
knowledge-tool-contracts-and-registry scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
86% identical to knowledge-extension-ecosystem-lsp-code-intelligence — 152 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Module Structure
该组件是所有内置工具、MCP 工具和 Agent 表面的共享契约层。工具定义在这里被校验并 投影为 Provider function schema,注册表再决定哪些声明进入当前模型上下文。
Directory Layout
packages/cli/src/tools/core/—createTool与UnifiedToolInvocationpackages/cli/src/tools/types/— 工具、结果、metadata、权限和执行上下文类型packages/cli/src/tools/validation/— TypeBox 校验、JSON Schema 投影和敏感文件识别packages/cli/src/tools/registry/— 内置/MCP 注册、索引、事件和延迟加载状态packages/cli/src/tools/artifacts/— 有界、私有、内容寻址的 Session 制品存储
Key Entry Points
createTool()inpackages/cli/src/tools/core/createTool.ts— 从ToolConfig构造完整工具对象ToolRegistryinpackages/cli/src/tools/registry/ToolRegistry.ts— 注册、筛选、克隆和投影工具目录DeferredToolManager.filterDeclarations()inpackages/cli/src/tools/registry/DeferredToolManager.ts— 只向模型暴露已加载 schemaparseToolSchema()inpackages/cli/src/tools/validation/schemaErrorFormatter.ts— 构建 invocation 前执行 TypeBox 运行时校验SessionArtifactStoreinpackages/cli/src/tools/artifacts/SessionArtifactStore.ts— MCP 与 Browser 共用的私有制品原语
API Surface
createTool
createTool(config)— 绑定 TypeBox schema、描述、权限签名、并发/重试能力和执行函数,并返回ToolTool.build(params)— 先解析默认值并拒绝无效输入,再创建不可变参数的ToolInvocationTool.getFunctionDeclaration()— 将内部 schema 和多段描述转换为 Provider function declarationTool.getMetadata()— 暴露工具目录元数据,包括显式归一化后的isRetrySafe与parallelism
ToolRegistry
register()/registerAll()— 注册内置工具并同步分类、标签和 deferred 状态replaceMcpTools()— 原子替换动态 MCP 目录并保留内置名称冲突保护getFunctionDeclarationsByMode()— 组合 Plan 模式过滤与 deferred schema 过滤clone()— 共享工具对象但重新建立注册表、索引与 deferred 状态drainMcp*()— 以有界队列向 Agent loop 交付 MCP 目录、内容、连接、日志和任务变化
DeferredToolManager
register()/syncDynamicTools()— 维护立即加载与延迟加载集合markLoaded()— 在ToolSearch成功后把完整 schema 纳入后续 Provider 请求getDeferredToolsListing()— 生成按名称排序的<available-deferred-tools>提示片段
SessionArtifactStore
write()— 校验单件/Session 配额,以 SHA-256 为 ID 写入0600文件并去重removeAll()— 删除一个 Session namespace 并重置内存计数
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 108 lines · 156 tokens per session scan A 3e767a9de0f3
knowledge-tool-contracts-and-registry is a skill published in the GitHub repository echoVic/blade-code (181 stars, last pushed 20d ago), licensed MIT. It adds 156 tokens to every session and 2,651 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 86% identical to knowledge-extension-ecosystem-lsp-code-intelligence, differing in 152 lines, and is treated as a copy.
knowledge-tool-contracts-and-registry compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| knowledge-tool-contracts-and-registryechoVic/blade-code | Skill | 181 | 20d ago | MIT | A | 156 | Claude Code, Codex |
| groq-inferencesynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 77 | Claude Code, Codex |
| bun-file-iosynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 49 | Claude Code, Codex |
| protocolsio-integrationsynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | B | 85 | Claude Code, Codex |
| langbot-devlangbot-app/LangBot | Skill | 19k | today | Apache-2.0 | A | 136 | Claude Code, Codex |
| clinical-decision-supportsynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 97 | Claude Code |
| immunology-assayssynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 79 | Claude Code, Codex |