knowledge-tool-contracts-and-registry

knowledge-tool-contracts-and-registry is a skill for Claude Code, Codex from echoVic/blade-code. It costs 156 tokens per session (2,651 once invoked), scanned A, a copy of knowledge-extension-ecosystem-lsp-code-intelligence, MIT.

A common contract and registry for built-in tools, MCP tools, and agent-facing tools. It validates tool parameters, decides which tools are visible to a model, and stores session artifacts privately.

In plain words
What is it for?
Use it when defining tools, changing their fields or schemas, registering or searching tools, managing delayed tool loading, or storing tool and browser artifacts.
Why use it?
It prevents tools from receiving invalid inputs and keeps unavailable or unloaded tool definitions out of the model's context.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

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.

agentmods
npx agentmods add skills/echovic/blade-code/tool-contracts-and-registry
Any agent
npx skills add echoVic/blade-code --skill tool-contracts-and-registry
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for knowledge-tool-contracts-and-registry

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/tool-contracts-and-registry.svg)](https://agentmods.dev/skills/echovic/blade-code/tool-contracts-and-registry)
Your own site
<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>
Per session 156 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,651 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 86% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 3d ago against content hash 3e767a9de0f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

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.

Origin

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.

.trae/knowledges/tool-and-automation-platform/tool-contracts-and-registry/SKILL.md · 108 lines

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/createToolUnifiedToolInvocation
  • packages/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() in packages/cli/src/tools/core/createTool.ts — 从 ToolConfig 构造完整工具对象
  • ToolRegistry in packages/cli/src/tools/registry/ToolRegistry.ts — 注册、筛选、克隆和投影工具目录
  • DeferredToolManager.filterDeclarations() in packages/cli/src/tools/registry/DeferredToolManager.ts — 只向模型暴露已加载 schema
  • parseToolSchema() in packages/cli/src/tools/validation/schemaErrorFormatter.ts — 构建 invocation 前执行 TypeBox 运行时校验
  • SessionArtifactStore in packages/cli/src/tools/artifacts/SessionArtifactStore.ts — MCP 与 Browser 共用的私有制品原语

API Surface

createTool

  • createTool(config) — 绑定 TypeBox schema、描述、权限签名、并发/重试能力和执行函数,并返回 Tool
  • Tool.build(params) — 先解析默认值并拒绝无效输入,再创建不可变参数的 ToolInvocation
  • Tool.getFunctionDeclaration() — 将内部 schema 和多段描述转换为 Provider function declaration
  • Tool.getMetadata() — 暴露工具目录元数据,包括显式归一化后的 isRetrySafeparallelism

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 并重置内存计数

Read the full file on GitHub · 108 lines

Changes

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.

  1. 3d ago First seen · 108 lines · 156 tokens per session scan A 3e767a9de0f3

Subscribe to this mod's changes

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.

Related

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.

synthetic-sciences/openscience · 77 tokens

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.

synthetic-sciences/openscience · 49 tokens

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…

synthetic-sciences/openscience · 85 tokens

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…

langbot-app/LangBot · 136 tokens

data-leakage-detection

Detect sensitive information disclosure via escalating dialogue probes. Covers system prompt extraction, credential/API key leakage, PII, and internal configuration exposure.

Tencent/AI-Infra-Guard · 34 tokens

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…

synthetic-sciences/openscience · 71 tokens