Skip to main content
Glama
HOI4 Agent Tools

HOI4 Agent Tools

by klimPaskov

Find invented commands in new script

hoi4.script_guard
Read-onlyIdempotent

Detect invented Hearts of Iron IV script commands, triggers, effects, and modifiers in specified or recently changed mod files, reporting file, line, and closest valid name.

Instructions

Check the files you wrote for invented commands: every effect, trigger and modifier that the installed game documentation does not list and no loaded file defines, with its file, line and the closest real name. Checks the named paths, or the mod script files changed in the last 120 minutes. Needs hoi4-engine. Example: {"paths":["events/my_events.txt"]}. Returns up to 40 names.

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.script_guard"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsNo
workspaceIdNocurrent
sinceMinutesNo

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

A4.1/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive and closed-world behavior, so the description is not carrying the safety burden. It adds genuinely non-obvious behavior: the engine prerequisite, the default 120-minute change window, and the 'up to 40 names' result cap that signals truncation. It says nothing about how ambiguity near-matches are ranked or what happens when no workspace content exists.

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?

The scope and detection criterion are front-loaded in the first sentence, followed by targeting, prerequisite, example and result cap in a compact sequence. Slightly dense and comma-heavy, but no sentence is padding.

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?

An output schema exists, so the description need not explain return values, yet it still flags the 40-name cap, which is useful. Prerequisite, targeting defaults and a usage example are all present for a three-parameter read tool. The main omission is the unmentioned workspaceId parameter and its 'current' default.

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 0%, so the description has to supply meaning. It maps 'named paths' to paths and the 'last 120 minutes' phrasing to sinceMinutes, and the example shows a concrete path format. But it never mentions workspaceId, never explains that sinceMinutes is adjustable (1-10080), and gives no guidance on the 50-path limit or path syntax beyond the single example.

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 description states a specific verb and object ('Check the files you wrote for invented commands') and then defines the criterion precisely: effects, triggers and modifiers absent from installed game documentation and undefined in any loaded file. That criterion distinguishes it in substance from a generic validation sibling without needing to name one, and it also states what is returned (file, line, closest real name).

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 gives clear operating context: check the named paths, or fall back to mod script files changed in the last 120 minutes, plus the prerequisite 'Needs hoi4-engine'. It does not explicitly say when to prefer this over hoi4.script_validate or hoi4.reference_search, so the agent must infer the boundary between 'invented' and other script problems.

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