Skip to main content
Glama
HOI4 Agent Tools

HOI4 Agent Tools

by klimPaskov

Explain error.log lines

hoi4.explain_error
Read-onlyIdempotent

Explains error.log lines by identifying the broken rule, source file and line with surrounding context, and the fix, while checking command documentation.

Instructions

Explain error.log lines: the rule each one breaks, its file and line with the lines around it, and the fix, from a reviewed catalogue of the game's messages. Says whether the game documents the command a line names, and the closest documented names. Example: {"line":"Invalid trigger 'stability' in events/my_events.txt line : 12"}. Returns up to 20 explanations (10 lines).

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": "hoi4.explain_error"
  }
}

Input Schema

NameRequiredDescriptionDefault
lineNo
linesNo
workspaceIdNocurrent

Output Schema

NameRequiredDescriptionDefault
codeYes
dataYes
statusYes
blockersNo
artifactsNo
validationYes
diagnosticsNo
workspaceIdYes
changedFilesNo
filesScannedNo
proposedFilesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.21.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive. The description adds real value beyond them: explanations come from a finite reviewed catalogue, output is capped at 20 explanations for 10 lines, and it will report whether a command is documented along with near-miss names.

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 purpose, then the content of the answer, then the input example and the output cap. The inline JSON example is slightly awkward to parse but earns its place by clarifying the accepted line format.

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 restating the returned fields is bonus rather than necessity. The remaining holes are the relationship between the 'line' and 'lines' parameters and the meaning of workspaceId, which matter for a tool with 0% schema coverage.

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 coverage is 0%, so the description must carry all parameter meaning. It shows the expected shape of 'line' via the JSON example and implies the 'lines' array via '10 lines', but never states that line and lines are alternatives (single vs batch) or what workspaceId selects beyond its 'current' default.

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 ('Explain') and resource ('error.log lines') and enumerates what the answer contains: rule broken, file/line with surrounding context, and the fix from a reviewed catalogue. It is distinguishable from the sibling hoi4.error_log by being an explanation rather than a retrieval tool, though no sibling is named.

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

Usage Guidelines3/5

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

Usage is implied: feed in error.log lines and get explanations. There is no explicit statement of when to prefer this over hoi4.error_log or hoi4.script_validate, and no exclusion like 'do not use for lines from other logs'.

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