agent-tool-use-patterns

agent-tool-use-patterns is a skill for Claude Code from selvarajmurugesan90/ops-engineering-skills. It costs 81 tokens per session (2,734 once invoked), scanned A, original, Apache-2.0.

A guide for designing the tools that AI agents can call and controlling the loop in which they call them.

In plain words
What is it for?
It helps define tool inputs, choose tool size and permissions, validate arguments, require confirmation, detect call loops, and handle untrusted tool output.
Why use it?
It helps prevent wrong tools, invented arguments, repeated calls, excessive autonomy, and unsafe instructions hidden in tool results.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code; mentions Codex; mentions Gemini CLI.

Part of the ai-agent-skills plugin — 20 skills shipped together

Good fit It helps define tool inputs, choose tool size and permissions, validate arguments, require confirmation, detect call loops, and handle untrusted tool output.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/selvarajmurugesan90/ops-engineering-skills/agent-tool-use-patterns
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 selvarajmurugesan90/ops-engineering-skills --skill agent-tool-use-patterns
Clone the repo
git clone --depth 1 https://github.com/selvarajmurugesan90/ops-engineering-skills

Made for: Claude Code.

Or install ai-agent-skills, the plugin that ships this one along with the rest of its 20 skills.

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 agent-tool-use-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/selvarajmurugesan90/ops-engineering-skills/agent-tool-use-patterns/github.svg)](https://agentmods.dev/skills/selvarajmurugesan90/ops-engineering-skills/agent-tool-use-patterns)
Your own site
<a href="https://agentmods.dev/skills/selvarajmurugesan90/ops-engineering-skills/agent-tool-use-patterns"><img src="https://agentmods.dev/badge/skills/selvarajmurugesan90/ops-engineering-skills/agent-tool-use-patterns/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 agent-tool-use-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/selvarajmurugesan90/ops-engineering-skills/agent-tool-use-patterns"><img src="https://agentmods.dev/badge/skills/selvarajmurugesan90/ops-engineering-skills/agent-tool-use-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,734 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 warn 7 Sept 2026
SkillSpector: 7 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 24
    Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.
    Fix: Set explicit rate limits, timeouts, and resource quotas for API calls, file operations, and compute. Implement circuit breakers for runaway loops.
  • medium Excessive Agency · line 86
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 237
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 238
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 239
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 240
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 250
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00081 $0.02734
Opus 5 $0.00041 $0.01367
Sonnet 5 $0.00016 $0.00547
Haiku 4.5 $0.00008 $0.00273

Measured 9d ago against content hash 056a7dfd14b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

agent-tool-use-patterns 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 9d 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.

plugins/ai-agent/skills/agent-tool-use-patterns/SKILL.md · 263 lines

How it starts

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

Agent Tool Use Patterns

Purpose

Tool/function calling is what turns an LLM from a text generator into an agent that can act on the world — but it is also the primary attack surface and failure surface of an agentic system. Wrong-tool selection, hallucinated arguments, infinite call loops, and prompt injection via tool results are not exotic edge cases; they are the default failure modes of any nontrivial tool-using agent and show up quickly under real usage. This skill covers designing the tool interface itself (schemas, granularity, permissions) and the dispatch loop around it (validation, confirmation gates, loop detection), independent of which vendor's tool-calling API is in use. Note that tools can be wired in ad hoc per-agent code, or exposed uniformly via an MCP server (see mcp-server-development); this skill applies to the tool design and dispatch layer regardless of which wiring is used underneath.

When to use

  • Designing a new set of tools/functions for an agent to call.
  • The agent calls a tool with a plausible but wrong argument (hallucinated ID, made-up file path, invented parameter value).
  • The agent gets stuck calling the same tool repeatedly without making progress.
  • Deciding whether a given tool needs a human confirmation step before executing.
  • A tool's output (a fetched web page, a file, a database row) may contain attacker-controlled text, and you need to reason about what that content can make the agent do next.
  • Reviewing an agent's tool permissions before granting it broader system access.

Prerequisites & environment

  • An LLM API/SDK with structured tool-calling support (JSON Schema–typed function definitions is the common shape across vendors, though exact request/response envelopes differ).
  • A dispatcher layer in your own code that receives the model's tool-call request and actually invokes the underlying function/API — this is where most of the safety logic in this skill lives, not in the model call itself.
  • Clarity on which tools are read-only vs. reversible-write vs. irreversible-write, established during agent-architecture-design.

Read the full file on GitHub · 263 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. 9d ago First seen · 263 lines · 81 tokens per session scan A 056a7dfd14b8

Subscribe to this mod's changes

agent-tool-use-patterns is a skill published in the GitHub repository selvarajmurugesan90/ops-engineering-skills (38 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 81 tokens to every session and 2,734 once invoked, about $0.0004 per session on Opus 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens