tool-calling-principles

tool-calling-principles is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 136 tokens per session (2,030 once invoked), scanned A, original, MIT.

A guide to designing agents that use tools and return structured results. It covers checking the environment, following an exact output format, and recovering from tool errors.

In plain words
What is it for?
Planning tool calls, validating JSON outputs, checking available environment details, and responding safely when a tool times out or returns unexpected data.
Why use it?
It reduces made-up answers and fragile tool use by requiring agents to verify assumptions and handle bad or incomplete responses carefully.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Planning tool calls, validating JSON outputs, checking available environment details, and responding safely when a tool times out or returns unexpected data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/tool-calling-principles
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j4flmao/agent-skills --skill tool-calling-principles
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tool-calling-principles

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/tool-calling-principles/github.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/tool-calling-principles)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/tool-calling-principles"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/tool-calling-principles/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tool-calling-principles

Your own site · 80×15
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/tool-calling-principles"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/tool-calling-principles.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 136 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,030 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00136 $0.02030
Opus 5.5 $0.00054 $0.00812
Sonnet 5.5 $0.00027 $0.00406
Haiku 4.5 $0.00014 $0.00203

Measured 3d ago against content hash c7dc6d130338, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tool-calling-principles scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ai/ai-agents/tool-calling-principles/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tool-Calling Principles

Purpose

Tools are the agent's only way to read or change the world, and the model chooses and fills them using nothing but names, descriptions, and schemas. Good tools are few, coarse-grained, strictly typed, safe to retry, and return compact results with actionable errors. This skill gives the rules and templates for designing them.

Agent Protocol

Trigger

"tool calling", "function calling", "tool schema", "tool description", "wrong tool selected", "tool errors", "strict mode", "structured output".

Input Context

  • The operations the agent needs and the underlying APIs.
  • Side effects of each operation (read, reversible write, irreversible).
  • Provider (Anthropic, OpenAI, other) and whether strict schema mode is available.
  • Observed failure transcripts if debugging.

Output Artifact

Tool definitions (JSON Schema), handler skeletons with validation and error contract, permission matrix.

Response Format

Tool: {verb_noun}  Side effect: {read|write-reversible|write-irreversible}  Approval: {none|human}
Description: {what, when to use, when NOT to use, output shape, limits}
Schema: {required fields, enums, formats}
Errors: {code: hint}
Idempotency: {key or natural}

Completion Criteria

  • Small, cohesive tool set; overlapping tools merged or removed.
  • Descriptions say when to use and when not to use.
  • Schemas use enums/formats/required fields; strict mode on where supported.
  • Errors return code + message + corrective hint.
  • Write tools idempotent; irreversible tools gated.

Design Rules

  1. Name by intent: search_orders, refund_order, not api_call or execute.
  2. Coarse over chatty: one get_customer_summary beats five getters the model must chain.
  3. Descriptions are prompts: purpose, when to use, when not to, input semantics, output shape, limits (e.g. "returns at most 20 rows").
  4. Constrain inputs: enum for categorical values, format/pattern for ids and dates, minimum/maximum for numbers, required for everything mandatory, additionalProperties: false.
  5. Flat, primitive arguments: nested objects raise error rates; prefer start_date, end_date over {range: {...}}.
  6. Compact outputs: return only fields the model needs; paginate with a cursor; cap size. Return the new state after a write ("refund R-91 created, status=pending"), not just true.
  7. Errors that teach: {"error": "ORDER_NOT_FOUND", "message": "...", "hint": "use search_orders with the customer's email first"}.
  8. Idempotency: write tools accept an idempotency key or are naturally idempotent (set, not increment).
  9. Least privilege: separate read and write tools so read-only agents never see writes.
  10. Never trust arguments: validate server-side; the schema is guidance to the model, not a security boundary.

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed · +111 lines · +112 tokens per session c7dc6d130338
  2. 2mo ago First seen · 51 lines · 24 tokens per session scan A 1e0165433fdc

Subscribe to this mod's changes

tool-calling-principles is a skill published in the GitHub repository j4flmao/agent-skills (36 stars, last pushed 3d ago), licensed MIT. It adds 136 tokens to every session and 2,030 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

composio

Route and complete Composio work across Composio For You and Composio Platform. Use when the user mentions Composio; wants an agent to use apps such as Gmail, Slack, GitHub, Notion, Calendar, or Linear; needs first-time setup, an SDK or MCP integration, CLI operation, migration guidance, current documentation, or help…

ComposioHQ/composio · 84 tokens

effect-v4

Write, review, or upgrade Effect v4 code in the Composio CLI, cli-keyring, and json-schema-to-effect-schema packages, all pinned exactly to [email protected] — Context.Service and explicit layers, Schema.TaggedError and typed recovery, the effect/cli command surface, and the vendored effect source oracle. Use when writing…

ComposioHQ/composio · 157 tokens

eve

Build durable backend AI agents with the eve framework. Use when creating, editing, or debugging an eve project — agent instructions, skills, tools, connections, channels, sandboxes, subagents, schedules, or evals.

ComposioHQ/composio · 47 tokens

cli-release

Release and recover first-party Composio CLI binaries through Build CLI Binaries, including automatic beta builds, promote-stable dispatches, beta-tag selection, asset and installation verification, and failed release recovery. Use when a contributor asks to build a CLI beta, publish or promote a stable CLI version…

ComposioHQ/composio · 95 tokens

verify-change

Maintain resumable task records, select repository verification profiles, inspect revision-bound receipts, and carry work between coding agents. Use for substantial SDK or CLI work spanning sessions, evidence review, or carrying work between coding agents; use package-specific skills for implementation and ordinary…

ComposioHQ/composio · 57 tokens

good-docs-audit

Audit a doc, guide, README, or block of prose against the good-docs-writing style guide and report violations. Use when the user asks to review, critique, lint, or check the voice and tone of documentation or text. Produces a structured findings report (file:line, rule violated, offending text, suggested rewrite) and…

ComposioHQ/composio · 82 tokens