Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Claude Code Api Tools

ASecurity

Use when implementing server-side tool schema and tool-call compatibility for a Claude Code Anthropic gateway, including tools arrays, tool_choice, tool_use SSE blocks, tool_result messages, deferred tools, MCP-style names, and tool parameter JSON.

4 stars
0 votes
0 copies
0 views
Added 9/20/2026
ai-agentsbashapi

Works with

claude codeapimcp

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add ZipperCode/lingma2api --skill claude-code-api-tools --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Claude Code Api Tools?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Claude Code Api Tools
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zippercode-claude-code-api-tools/badge)](https://www.skillsdirectory.com/skills/zippercode-claude-code-api-tools)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: claude-code-api-tools
description: Use when implementing server-side tool schema and tool-call compatibility for a Claude Code Anthropic gateway, including tools arrays, tool_choice, tool_use SSE blocks, tool_result messages, deferred tools, MCP-style names, and tool parameter JSON.
---

# Claude Code 网关工具调用协议

## 目标

根据本 skill,实现大模型网关中的工具调用兼容。服务端需要理解 Claude Code 发来的 `tools` schema,并在模型需要工具时返回 Anthropic `tool_use` block;客户端下一轮会回传 `tool_result`。

详细字段见 `references/tool-schema-wire-format.md`。

## 请求中的 tools

`POST /v1/messages` 可能包含:

```json
{
  "tools": [
    {
      "name": "Bash",
      "description": "...",
      "input_schema": { "type": "object", "properties": {}, "required": [] }
    }
  ],
  "tool_choice": { "type": "auto" }
}
```

网关要求:

- 保留工具 `name`,响应中的 `tool_use.name` 必须完全匹配。
- `input_schema` 是 JSON Schema;你可以传给上游模型,也可以转换为上游工具格式。
- 容忍 `strict`、`eager_input_streaming`、`defer_loading`、`cache_control` 等扩展字段。
- MCP 工具名形如 `mcp__server_name__tool_name`,不要拆错。

## 返回 tool_use

流式:

```text
content_block_start: {"type":"tool_use","id":"toolu_1","name":"Bash","input":{}}
content_block_delta: {"type":"input_json_delta","partial_json":"{\"command\""}
content_block_delta: {"type":"input_json_delta","partial_json":":\"ls\"}"}
content_block_stop
message_delta: {"stop_reason":"tool_use"}
message_stop
```

非流式:

```json
{
  "content": [
    { "type": "tool_use", "id": "toolu_1", "name": "Bash", "input": { "command": "ls" } }
  ],
  "stop_reason": "tool_use"
}
```

## 接收 tool_result

Claude Code 下一轮会发送:

```json
{
  "role": "user",
  "content": [
    { "type": "tool_result", "tool_use_id": "toolu_1", "content": "file list", "is_error": false }
  ]
}
```

网关要把它作为上一轮工具执行结果传给上游模型。`tool_use_id` 必须和之前返回的 `tool_use.id` 对上。

## Deferred tools

如果工具带 `defer_loading:true`,表示服务端可以只把名称/描述暴露给模型,完整 schema 可能通过 ToolSearch 工作流补齐。外部网关最小实现可以忽略 defer,直接把工具当普通工具传给上游;但不要因为该字段报错。

## 兼容要求

- `input_json_delta.partial_json` 拼接后必须是 JSON object。
- 如果上游模型返回 OpenAI function call,网关要转换成 Anthropic `tool_use`。
- 如果上游工具调用参数不是合法 JSON,返回 502 或合成文本错误,不要输出畸形 `input_json_delta`。
- 不要执行工具;Claude Code 客户端负责本地工具执行。网关只负责让模型请求工具,并在下一轮读取结果。

Attribution

ZipperCodeZipperCode
View sourceMore from ZipperCode →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Caveman

Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.

1023331 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

686011 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3331 votes

catchup

Recovers prior coding-agent session context by running `catchup <agent> --since-compact`, which extracts a clean summary of a previous Codex, Claude Code, Antigravity, OpenCode, or Pi Agent session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", or asks to recover/summarize a previous session before continuing. Do NOT use for the current conversation, git history, or any non-agent log.

611 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →