function-calling
LLM function calling and tool use patterns. Use when enabling LLMs to call external tools, defining tool schemas, implementing tool execution loops, or getting structured output from LLMs.
npx skills add majiayu000/claude-skill-registry --skill function-calling --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Function Calling Enable LLMs to use external tools and return structured data. ## When to Use - LLM needs to call APIs or databases - Extracting structured data from text - Building AI agents with tool use - Reliable JSON output from LLMs ## Basic Tool Definition (2026 Best Practice) ```python # OpenAI format with strict mode (2026 recommended) tools = [{ "type": "function", "function": { "name": "search_documents", "description": "Search the document database for relevant content", "strict": True, # ← 2026: Enables structured output validation "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "The search query" }, "limit": { "type": "integer", "description": "Max results to return" } }, "required": ["query", "limit"], # All props required when strict "additionalProperties": False # ← 2026: Required for strict mode } } }] # Note: With strict=True: # - All properties must be listed in "required" # - additionalProperties must be False # - No "default" values (provide via code instead) ``` ## Tool Execution Loop ```python async def run_with_tools(messages: list, tools: list) -> str: """Execute tool calls until LLM returns final answer."""
- When to Use
- Basic Tool Definition (2026 Best Practice)
- Tool Execution Loop
- Structured Output (Guaranteed JSON)
- LangChain Tool Binding
- Parallel Tool Calls
- Key Decisions
- Common Mistakes
- Related Skills
- Capability Details
- tool-definition
- tool-execution-loop
- structured-output
- parallel-tool-calls
What does the function-calling skill do?
LLM function calling and tool use patterns. Use when enabling LLMs to call external tools, defining tool schemas, implementing tool execution loops, or getting structured output from LLMs.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill function-calling --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
