tool-integration-protocol

A step-by-step guide for adding a new external tool to an AI agent's tool registry. It covers the handler, the model's tool list, and the toolset assignment.

In plain words
What is it for?
Use it when creating a tool handler, declaring its inputs and requirements, importing it into the agent, and assigning it to a toolset.
Why use it?
It reduces the chance of missing one of the required integration points when connecting a tool to the agent.

Skill for Claude CodeCodex

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/humanerd-drew/opencode-drewgent/tool-integration-protocol
Any agent
npx skills add humanerd-drew/opencode-drewgent --skill tool-integration-protocol
Clone the repo
git clone --depth 1 https://github.com/humanerd-drew/opencode-drewgent

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 666 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00000 $0.00666
Opus 5 $0.00000 $0.00333
Sonnet 5 $0.00000 $0.00133
Haiku 4.5 $0.00000 $0.00067

Measured 2d ago against content hash d68019d4b731, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tool-integration-protocol 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 2d 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.

@action/skills/devops/tool-integration-protocol/SKILL.md · 101 lines

What it actually says

space: outcome type: document links:

  • "[[@action/skills/devops/DESCRIPTION]]"
  • "[[@action/skills/SKILL-INDEX]]"

Tool Integration Protocol

{{AGENT_NAME}}에 새로운 도구를 추가할 때 사용하는 표준 절차.

3단계 통합 패턴

Step 1: 도구 핸들러 파일

파일: tools/<name>_tool.py

import json, os
from tools.registry import registry

def check_requirements() -> bool:
    return bool(os.getenv("YOUR_API_KEY"))  #또는 True

def your_tool(param: str, task_id: str = None) -> str:
    return json.dumps({"success": True, "data": "..."})

registry.register(
    name="your_tool",
    toolset="your_toolset",
    schema={
        "name": "your_tool",
        "description": "...",
        "parameters": {
            "type": "object",
            "properties": {
                "param": {"type": "string", "description": "..."}
            },
            "required": ["param"]
        }
    },
    handler=lambda args, **kw: your_tool(
        param=args.get("param", ""),
        task_id=kw.get("task_id")
    ),
    check_fn=check_requirements,
    requires_env=["YOUR_API_KEY"],  #또는 []
)

Step 2: model_tools.py import 추가

파일: model_tools.py, _discover_tools() 함수의 _modules 리스트

"tools.your_tool",  # 알파벳 순서로 추가

Step 3: toolsets.py에 toolset 배정

파일: toolsets.py

_HERMES_CORE_TOOLS에 추가:

"your_tool",

필수 검증 체크리스트

  • registry.register() 호출됨
  • schema["parameters"]["type"] = "object" 확인
  • model_tools.py import 추가됨
  • toolsets.py toolset 배정됨
  • P0 禁tool_integration_3file 위반 없음

Workflow 추적

IntegrationWorkflow가 signal_processor에서 자동 추적됨. 완료 시 brain.awareness.integration_complete 시그널 발생.

Pitfalls

  1. import 안 함 → 도구 레지스트리에 안 올라감
  2. toolset 안 배정 → tool_schemas에 안 포함됨
  3. check_fn이 False → availability check 실패
  4. handler가 JSON string 안 반환 → tool result 파싱 에러
  5. requires_env 빈 배열 → API 키 없어도 등록됨 (의도한 경우 제외)
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. 2d ago First seen · 101 lines · 0 tokens per session scan A d68019d4b731

Subscribe to this mod's changes

tool-integration-protocol is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (2 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 666 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

agent-host-chat-contributions

Build and review cross-cutting agent-host chat behavior through lifecycle contributions. Use when adding turn lifecycle side effects, prompt or context injection, restored-history transformation, protocol-action observation, or when reviewing changes that add code to AgentSideEffects or AgentService.

microsoft/vscode · 56 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens