Skip to main content
Glama

intercept_tool_call

Inspect AI agent tool-call payloads before runtime invocation, returning a security verdict and containment action to block unsafe shell, eval(), or socket-egress attempts.

Instructions

Intercept and evaluate an autonomous AI agent tool execution payload before runtime invocation.
Determines whether the execution is safe or requires immediate containment.

Args:
    actor_id: Unique identifier or name of the calling agent, user, or process.
    tool_name: The target tool, environment, or command type (e.g., 'bash', 'sql', 'python', 'eval').
    payload: The raw code, shell command, query, or parameters to be inspected by the circuit breaker.

Returns:
    Dictionary containing the security verdict ('PERMITTED' or 'HALT_AND_CONTAIN'),
    authorization status, cryptographic execution token (if permitted), risk score,
    and detected AST primitives.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payloadYes
actor_idYes
tool_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses useful behavior beyond the schema — a verdict of PERMITTED or HALT_AND_CONTAIN, issuance of a cryptographic execution token, risk scoring, and AST primitive detection — but omits side effects (token issuance/mutation), required authorization or credentials, idempotency, and what happens operationally when containment triggers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The lead sentence is well front-loaded and the Args/Returns docstring structure is scannable, but it reads as an internal docstring rather than an agent-facing definition, and the Returns block restates information the output schema already provides.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the enumerated return values are redundant rather than necessary. For a security-gating tool with no annotations and three required parameters, the description still leaves out the critical operational facts: whether this call is a mandatory precondition, what authorization it needs, and how it relates to its two sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: all three parameters are defined with intent and examples (actor_id as caller identity, tool_name as target type with 'bash'/'sql'/'python'/'eval' examples, payload as the raw artifact to inspect). It lacks format constraints such as max payload size or accepted tool_name values, but the semantic gap is largely closed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Intercept and evaluate an autonomous AI agent tool execution payload') and the outcome it decides (safe vs. requires containment). It is clear on its own, but never distinguishes itself from siblings like analyze_code_ast, which also inspects code/AST content, leaving overlap for an agent to resolve.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when this must be called versus alternatives. The description implies a pre-invocation gate but never says it is mandatory before every tool execution, nor when to prefer analyze_code_ast or get_circuit_breaker_telemetry instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.