Agent skill
tool-calling
Implement tool calling - function schemas, API integration, validation, and error handling
Install this agent skill to your Project
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-ai-agents/tree/main/skills/tool-calling
SKILL.md
Tool Calling
Enable LLMs to call functions and interact with external systems.
When to Use This Skill
Invoke this skill when:
- Adding function calling to agents
- Designing tool schemas
- Integrating external APIs
- Implementing validation and error handling
Parameter Schema
| 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 |
Quick Start
Claude Tool Use
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?"}]
)
LangChain Tools
from langchain_core.tools import tool
@tool
def search(query: str) -> str:
"""Search the web for information."""
return web_search(query)
Schema Best Practices
# 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"}
Troubleshooting
| 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 |
Best Practices
- Use verb_noun naming convention
- Keep tool count under 20
- Include usage examples in descriptions
- Return errors as tool results
Related Skills
ai-agent-basics- Agent loopsllm-integration- API setupagent-safety- Input validation
References
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
llm-integration
Integrate LLMs into applications - APIs, prompting, fine-tuning, and context management
rag-systems
Build RAG systems - embeddings, vector stores, chunking, and retrieval optimization
ai-agent-basics
Master AI agent fundamentals - architectures, ReAct patterns, cognitive loops, and autonomous system design
agent-memory
Implement agent memory - short-term, long-term, semantic storage, and retrieval
agent-safety
Ensure agent safety - guardrails, content filtering, monitoring, and compliance
multi-agent
Build multi-agent systems - orchestration, coordination, workflows, and distributed architectures
Didn't find tool you were looking for?