Skip to main content
Glama

read_guard

Read-onlyIdempotent

Acts as a PreToolUse hook for Claude Code Read and Bash calls, guarding file access and command execution before they run.

Instructions

Hook only, do not call: Claude Code's PreToolUse hooks on Read and Bash call it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "read_guard"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoLimit.
offsetNoOffset.
commandNoBash command.
file_pathNoFile.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds the genuinely useful behavioral fact that invocation is hook-driven rather than agent-driven, but says nothing about return values, side effects on the guard/policy state, or what happens on a blocked read.

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

Conciseness4/5

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

A single short sentence with the most important constraint, 'do not call', front-loaded — zero wasted words. It is borderline under-specified rather than padded, so the terseness is efficient but leaves the reader wanting one more clause about what the hook does.

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?

For a non-callable hook shim, the 'do not call' framing plus annotations may be enough for an agent to avoid it, and no output schema exists to explain. However, with four parameters and a dual Read/Bash trigger, the definition never states what the tool returns or how it decides, so it is adequate but thin.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter carries an inline description and the baseline of 3 applies. The description adds no meaning about how limit/offset/command/file_path interact or which ones the Read hook supplies versus the Bash hook, despite those labels being minimal ('Limit.', 'File.').

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

Purpose3/5

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

The description identifies the tool as a hook endpoint triggered by Claude Code's PreToolUse hooks on Read and Bash, which explains its origin but not what it actually does (validate a read? gate a bash command?). It is a noun-ish label rather than a specific verb+resource, leaving the agent to infer the operation from the parameter names.

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 opening 'Hook only, do not call' is an unambiguous exclusion that prevents an agent from mis-selecting this tool, and the remainder explains who does call it. It stops short of naming what the agent should use instead for reading files or running commands, so it is clear context without a full alternative map.

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