Implement tool calling - function schemas, API integration, validation, and error handling
Implement function calling with schemas, API integration, and validation for Anthropic, OpenAI, and LangChain. Use when building agents that need to interact with external APIs or execute functions.
/plugin marketplace add pluginagentmarketplace/custom-plugin-ai-agents/plugin install custom-plugin-ai-agents@pluginagentmarketplace-ai-agentsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/claude_tool_use.pyscripts/validate.pyEnable LLMs to call functions and interact with external systems.
Invoke this skill when:
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
task | string | Yes | Tool calling goal | - |
provider | enum | No | anthropic, openai, langchain | anthropic |
strict_mode | bool | No | Enable strict validation | true |
from anthropic import Anthropic
tools = [{
"name": "get_weather",
"description": "Get weather for a location",
"input_schema": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}]
response = client.messages.create(
model="claude-sonnet-4-20250514",
tools=tools,
messages=[{"role": "user", "content": "Weather in Tokyo?"}]
)
from langchain_core.tools import tool
@tool
def search(query: str) -> str:
"""Search the web for information."""
return web_search(query)
# Good: verb_noun, clear description
{
"name": "search_products",
"description": """Search product database.
USE WHEN: User asks about products.
DO NOT USE: For order status (use get_order instead)."""
}
# Bad: vague
{"name": "helper", "description": "Helps with stuff"}
| Issue | Solution |
|---|---|
| Tool not called | Improve description |
| Wrong tool selected | Add "DO NOT USE" conditions |
| Invalid arguments | Enable strict mode |
| Execution timeout | Add timeout, retry logic |
ai-agent-basics - Agent loopsllm-integration - API setupagent-safety - Input validationThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.