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 agentmods add skills/echovic/blade-code/tool-contracts-and-registrynpx 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.svg" alt="Measured on agentmods" 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 | $0.00078 | $0.01326 |
| Sonnet 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 3d 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.
- 3d 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 (178 stars, last pushed today), licensed MIT. It adds 156 tokens to every session and 2,651 once invoked, about $0.0008 per session on Opus 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.
Other skills, from other repositories
groq-inference
Ultra-fast LLM inference on custom LPU hardware. OpenAI-compatible API at api.groq.com. Lowest latency in the industry (500-1000+ tok/s). Supports chat completions, vision, audio (Whisper STT + TTS), tool calling, JSON mode, and streaming. Free tier available. Inference only — no training.
bun-file-io
Use this when you are working on file operations like reading, writing, scanning, or deleting files. It summarizes the preferred file APIs and patterns used in this repo. It also notes when to use filesystem helpers for directories.
protocolsio-integration
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io…
langbot-dev
Develop, build, and debug the LangBot core backend and web frontend. Use when working inside the LangBot repository — backend (Python/Quart, src/langbot/pkg), the Vite/React web UI, HTTP API controllers/services, Alembic migrations, or the MCP server. Covers the dev environment (uv, pnpm), repo layout, the API auth…
data-leakage-detection
Detect sensitive information disclosure via escalating dialogue probes. Covers system prompt extraction, credential/API key leakage, PII, and internal configuration exposure.
clinical-reports
Write comprehensive clinical reports including case reports (CARE guidelines), diagnostic reports (radiology/pathology/lab), clinical trial reports (ICH-E3, SAE, CSR), and patient documentation (SOAP, H&P, discharge summaries). Full support with templates, regulatory compliance (HIPAA, FDA, ICH-GCP), and validation…