Skip to main content
Glama

guard_budget

Read-onlyIdempotent

Reports this session's recorded tool-output size and top tools by characters, helping identify which tool results are inflating context so you can act before limits hit.

Instructions

Report this session's recorded tool-output size.

Use it when the context watermark is climbing or a turn is getting large, to see which tools produced the bytes. It takes no parameters. It reads events.jsonl for the current session (PC_SESSION_ID, or default) and returns PC budget, the character total, an estimate of tokens (integer division of characters by 4), the tool-result count, the top 5 tools by characters, and a Nudge. Side effects: none. It does not create .agent-guard/ and does not write events. A missing ledger is an empty budget.

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": "guard_budget"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive, closed-world), the description discloses the data source (events.jsonl, PC_SESSION_ID or default), the exact return contents including token estimation via integer division, and explicit side-effect guarantees: nothing is written and .agent-guard/ is not created. It even defines the edge case of a missing ledger as an empty budget.

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?

Front-loaded with the purpose, then usage, then behavior, in a compact multi-sentence block. The enumeration of return fields is somewhat dense and partially redundant with the output schema, but every line carries functional information.

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

Completeness5/5

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

For a zero-parameter read tool, the definition covers purpose, trigger, data source, session resolution, return shape, and side effects, and it is consistent with the readOnly/idempotent annotations. An agent has everything needed to call it correctly and interpret the result.

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?

With zero parameters the baseline is 4, and the description correctly confirms 'It takes no parameters', so there is no ambiguity about call shape. There is no additional parameter meaning to add.

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?

The opening sentence gives a specific verb and resource: reporting the session's recorded tool-output size, with the added purpose of attributing bytes to individual tools. It is clearly distinct from the guard_* inspection/verification siblings by what it measures, though it never names an alternative tool directly.

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?

It states a concrete trigger condition: use it when the context watermark is climbing or a turn is getting large. It gives no explicit when-not guidance or named alternative (e.g. guard_status vs guard_evidence), which keeps it below a 5.

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