# Tool Call Guard

> A Claude skill from 0-uddeshya-0/agent-skills.

- **Type:** Skill
- **Install:** `agentstack add skill-0-uddeshya-0-agent-skills-tool-call-guard`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [0-uddeshya-0](https://agentstack.voostack.com/s/0-uddeshya-0)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [0-uddeshya-0](https://github.com/0-uddeshya-0)
- **Source:** https://github.com/0-uddeshya-0/agent-skills/tree/main/skills/tool-call-guard

## Install

```sh
agentstack add skill-0-uddeshya-0-agent-skills-tool-call-guard
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# skill: tool-call-guard

## purpose
Validate a tool call before it executes. Catches missing parameters, malformed values, and scope overreach. Blocks bad calls. Warns on irreversible ones. Prevents wasted API calls and accidental side effects.

## when_to_use
- Before every external tool call in an agent loop
- Tool call involves writes, deletes, or sends
- Input to the tool comes from user text that might be incomplete or malformed

## when_not_to_use
- Simple safe read operations where calling is always correct
- You've already validated this exact call this turn

## input
```
tool_name: string          # Tool you're about to call
tool_params: object        # Parameters you're about to pass
tool_schema: object        # Expected types/requirements (optional — skip validation step if not provided)
task_context: string       # Why you're making this call
is_destructive: boolean    # Creates, modifies, sends, or deletes data?
```

## output
```json
{
  "approved": true | false,
  "issues": ["string"],
  "safe_to_call": true | false,
  "warning": "string | null",
  "corrected_params": "object | null"
}
```

## instructions

```
Check this tool call before it executes.

Validate:
1. NECESSITY: Is this call needed for the task, or can the task be done without it?
2. PARAMETERS: Required params present? Types correct? Values in expected range?
3. SCOPE: Does this call do exactly what the task requires, or could it do more?
4. SIDE EFFECTS: If destructive, is scope limited to what was authorized?

Reject if: required param missing or null, value clearly wrong (negative ID, empty required field, wrong format), call would affect more data than intended.

Warn if: call is approved but irreversible.

Correct if: param has fixable format issue (whitespace, wrong case for enum, missing prefix). Never change values that affect intent.

safe_to_call is false if: not approved, OR is_destructive is true and warning is present.

Return JSON only.
```

## constraints
- Max output tokens: 200
- corrected_params: fix format only, never change intent
- safe_to_call false if destructive + has warning
- If approved AND corrected_params is non-null: always use corrected_params in the actual call, not the original tool_params

## example

**Input:**
```
tool_name: "delete_user"
tool_params: { "user_id": "", "confirm": true }
tool_schema: { "user_id": "required non-empty string", "confirm": "required boolean" }
task_context: "Delete account for user ID 8821"
is_destructive: true
```

**Output:**
```json
{
  "approved": false,
  "issues": ["user_id is empty — required param missing. Context shows it should be 8821."],
  "safe_to_call": false,
  "warning": null,
  "corrected_params": { "user_id": "8821", "confirm": true }
}
```

## feedback_log

# 2026-05-29 | approved:true + corrected_params set — caller used original params anyway | output combination was undocumented; callers didn't know to prefer corrected_params | added to constraints: always use corrected_params when non-null, even when approved

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [0-uddeshya-0](https://github.com/0-uddeshya-0)
- **Source:** [0-uddeshya-0/agent-skills](https://github.com/0-uddeshya-0/agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-0-uddeshya-0-agent-skills-tool-call-guard
- Seller: https://agentstack.voostack.com/s/0-uddeshya-0
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
