tool-calling

Implement tool calling - function schemas, API integration, validation, and error handling

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tool-calling" with this command: npx skills add pluginagentmarketplace/custom-plugin-ai-agents/pluginagentmarketplace-custom-plugin-ai-agents-tool-calling

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

ParameterTypeRequiredDescriptionDefault
taskstringYesTool calling goal-
providerenumNoanthropic, openai, langchainanthropic
strict_modeboolNoEnable strict validationtrue

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

IssueSolution
Tool not calledImprove description
Wrong tool selectedAdd "DO NOT USE" conditions
Invalid argumentsEnable strict mode
Execution timeoutAdd 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 loops
  • llm-integration - API setup
  • agent-safety - Input validation

References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

agent-memory

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

rag-systems

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

llm-integration

No summary provided by upstream source.

Repository SourceNeeds Review