Skip to main content
Glama

List hooks

hook_list
Read-only

List all registered Garry's Mod hooks by realm with defining file and line; filter by event to detect missing or mistyped hook registrations.

Instructions

Hooks registered with hook.Add in a realm (hook.GetTable), with where each function was defined. Without event: every event (large). Result: {hooks: {: [{id, source (file), line, what}]}, count}, and with event: event, known (false = no hook and no gamemode function for that name: probably a typo) and gamemode_function (source of GAMEMODE:, or null). Example: {"realm": "client", "event": "Think"}.

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

Input Schema

NameRequiredDescriptionDefault
eventNoEvent name (e.g. Think).
realmNoDefault server.
instanceNoOptional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance.

Output Schema

NameRequiredDescriptionDefault
nextNo
noteNo
countYes
eventNo
hooksYes
knownNo
warningNo
next_callNo
answered_byNo
truncated_noteNo
version_warningNo
gamemode_functionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover read-only and closed-world behavior. The description adds meaningful behavioral detail: the large result when `event` is omitted, the `known` flag indicating a probable typo, and the `gamemode_function` fallback. It does not discuss permissions, rate limits, or the instance relay behavior.

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 description is front-loaded and dense with useful information, with no wasted filler. It includes result shape and an example; some return-shape detail overlaps with the output schema, but the added semantics justify most of it.

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?

For a list tool with full schema descriptions and an output schema, the description covers purpose, optional event behavior, and key result semantics. It omits explicit mention of the `instance` relay parameter and sibling differentiation, but the schema already handles `instance`.

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 100%, so the schema already documents the parameters. The description adds value by explaining the semantic effect of omitting `event` versus providing it, including the fields returned in each case. It does not add detail for `realm` or `instance` beyond what the schema provides.

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 description states a specific resource and operation: hooks registered via hook.Add in a realm, with definition locations. It is clear what the tool returns, but it does not explicitly distinguish itself from related siblings like hook_trace or perf_hook_cost.

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 description implies that omitting `event` lists every event and is large, while supplying `event` narrows the result. It does not explicitly state when to use this tool versus hook_trace or perf_hook_cost, so usage guidance is implied rather than complete.

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