# Tool Integration Protocol

> A Claude skill from humanerd-drew/opencode-drewgent.

- **Type:** Skill
- **Install:** `agentstack add skill-humanerd-drew-opencode-drewgent-tool-integration-protocol`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [humanerd-drew](https://agentstack.voostack.com/s/humanerd-drew)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [humanerd-drew](https://github.com/humanerd-drew)
- **Source:** https://github.com/humanerd-drew/opencode-drewgent/tree/main/@action/skills/devops/tool-integration-protocol

## Install

```sh
agentstack add skill-humanerd-drew-opencode-drewgent-tool-integration-protocol
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

space: outcome
type: document
links:
  - "[[@action/skills/devops/DESCRIPTION]]"
  - "[[@action/skills/SKILL-INDEX]]"

# Tool Integration Protocol

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

## 3단계 통합 패턴

### Step 1: 도구 핸들러 파일

파일: `tools/_tool.py`

```python
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` 리스트

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

### Step 3: toolsets.py에 toolset 배정

파일: `toolsets.py`

_HERMES_CORE_TOOLS에 추가:
```python
"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 키 없어도 등록됨 (의도한 경우 제외)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [humanerd-drew](https://github.com/humanerd-drew)
- **Source:** [humanerd-drew/opencode-drewgent](https://github.com/humanerd-drew/opencode-drewgent)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-humanerd-drew-opencode-drewgent-tool-integration-protocol
- Seller: https://agentstack.voostack.com/s/humanerd-drew
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
