Skip to main content
Glama
io.github.justrunme/agent-security-contract

io.github.justrunme/agent-security-contract

by justrunme

check_tool_call

Checks a proposed tool call against an ASC policy contract and returns a PASS, BLOCK, or REQUIRE_APPROVAL verdict with reasons. Fails closed on errors so unsafe calls are blocked before execution.

Instructions

Check a proposed tool call against an ASC policy contract.

Returns PASS/BLOCK/REQUIRE_APPROVAL verdict with reasons. Fail-closed: any error, missing policy, or unknown input yields BLOCK. Use this tool before executing any tool call to enforce a security contract.

Args: policy_path: Path to the ASC policy YAML file trace_data: Tool call trace mapping with agent_id, trace_id, calls, optional tool_catalog scenario_id: Identifier for this check (for reporting)

Returns: Mapping with verdict, reason, scenario_id, blocked_call_id, and details

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "policy_path": "<policy_path>",
      "trace_data": "<trace_data>"
    },
    "name": "check_tool_call"
  }
}

Input Schema

NameRequiredDescriptionDefault
trace_dataYes
policy_pathYes
scenario_idNomcp-check

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses the fail-closed semantics (errors, missing policy, or unknown input all yield BLOCK) and the verdict set. It does not say whether the check itself is read-only or has any side effects on policy state, nor how expensive it is, which keeps it below a 5.

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

Conciseness5/5

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

Front-loaded with purpose, then fail-closed behavior, then Args/Returns blocks. Every line adds information; the only near-redundancy is restating the verdict in the Returns section, which is acceptable given an output schema exists but is not described in prose elsewhere.

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

Completeness4/5

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

For a security-gate tool with a nested, loosely-typed trace_data parameter, the definition covers purpose, failure mode, verdicts, and parameter roles. Since an output schema exists, the Returns block is a bonus rather than a requirement. Missing only side-effect/read-only disclosure and guidance on where a valid policy_path comes from.

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% and trace_data is an untyped nested object, so the description has to compensate — and it does, enumerating the expected trace_data keys (agent_id, trace_id, calls, optional tool_catalog) and noting scenario_id is for reporting. It omits format details for the policy YAML and the shape of each entry in calls.

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

Purpose5/5

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

The opening sentence names a specific verb and resource: checking a proposed tool call against an ASC policy contract. It also states the output vocabulary (PASS/BLOCK/REQUIRE_APPROVAL), so an agent knows exactly what class of operation this is without opening the schema.

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

Usage Guidelines4/5

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

The description gives an explicit trigger: "Use this tool before executing any tool call to enforce a security contract." That is clear placement guidance. It stops short of naming when not to use it or pointing at a sibling for adjacent tasks (e.g. listing available policies), so it falls short of a 5.

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