Skip to main content
Glama
pz-modding-mcp

pz-modding-mcp

by MrMikojo

show_lua_function

Prints one Lua function or table from a Project Zomboid file with line numbers, so you can inspect a specific definition without reading the entire file.

Instructions

Print ONE Lua function or table from a file, with line numbers, instead of reading a whole file. path = a file in your workspace (your mod) or in PZ's media folder, e.g. "media/lua/client/ISUI/ISInventoryPane.lua"; name = "ISInventoryPane:onMouseDown", "MyMod.onTick", "Recipe". A short path is searched for under the readable folders (see pz_status).

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": {
      "path": "<path>",
      "name": "<name>"
    },
    "name": "show_lua_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses that output is line-numbered, that only one symbol is returned, and that short paths are resolved against readable folders via pz_status. It does not say what happens when the name is missing or ambiguous, whether matching is case-sensitive or partial, or that the operation is read-only.

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 core action and contrast, followed by compact per-parameter notes. Dense but every sentence adds usable information; no filler.

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 return structure needn't be described, and both required parameters are given meaning and examples despite 0% schema coverage. The remaining gap is failure/ambiguity behavior, which matters for a lookup-by-name tool but is a modest omission.

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 coverage is 0% and both parameters are bare titles, so the description must compensate — and it largely does: path is explained as a workspace/mod file or PZ media path with a concrete example, and name is illustrated with three qualified forms ('ISInventoryPane:onMouseDown', 'MyMod.onTick', 'Recipe'). It stops short of describing matching rules or ambiguity handling.

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 and resource: print ONE Lua function or table from a file, with line numbers, and explicitly contrasts it with reading a whole file. The single-item scope and line-number output make it distinguishable from a whole-file reader, though no sibling tool is named directly.

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?

The phrase 'instead of reading a whole file' implies when to reach for this over a file-read tool, and '(see pz_status)' redirects to another tool for folder discovery. However, no alternative is named explicitly and no when-not condition (e.g. searching by pattern across files) is given.

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