Skip to main content
Glama

Search the live Lua API

api_search
Read-only

Search running Garry's Mod realms by substring or glob to confirm which Lua global functions, library functions, and metatable methods actually exist in the current build.

Instructions

Asks each running realm which functions really exist in this game build: global functions, library functions (util.TraceLine) and metatable methods (Entity:EmitSound). Only realms that exist answer: menu always (client mode), client and server only with a map loaded (realms_searched says which answered). Source of truth for realms when the wiki disagrees. Pattern: case-insensitive substring, or a glob with * matched against the whole name. Result: {results: [{name, kind: global|library|method, realms: [...], wiki_page (URL or null)}], count, realms_searched, wiki_index}. wiki_page needs the wiki page list (wiki_search once). Example: {"pattern": "Entity:Emit*"}.

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": {
      "pattern": "<pattern>"
    },
    "name": "api_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoPer realm, default 500.
realmNoRestrict to one realm (default: all available).
patternYes
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
patternNo
resultsYes
warningNo
next_callNo
wiki_indexNo
answered_byNo
truncated_noteNo
realms_searchedNo
version_warningNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4.6/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint it discloses real behavioral constraints: menu realm always answers, client/server only with a map loaded, and realms_searched reports which answered. It also explains the wiki_page field's dependency and shows the return shape, which the agent could not infer from annotations.

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-loads what the tool does, then realm availability, matching rules, and result shape in a compact sequence. It is dense but nearly every clause carries information; the trailing example is useful rather than padding.

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 read-only search with four parameters and an output schema, the description covers matching semantics, realm availability, return fields, and cross-tool dependency. An agent has everything needed to invoke it correctly on the first try.

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?

Adds substantial meaning for pattern (case-insensitive substring vs. glob with * matched against the whole name) plus a concrete example. Realm behavior is partially covered by the realm-availability narrative, but limit and instance are left entirely to the schema, which covers 75% of parameters.

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?

States a specific verb and resource: queries each running realm for functions that actually exist in this build, covering globals, library functions, and metatable methods. The parenthetical examples (util.TraceLine, Entity:EmitSound) and the 'source of truth when the wiki disagrees' framing separate it cleanly from wiki_search and lua_inspect.

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?

Gives a clear use condition ('source of truth for realms when the wiki disagrees') and a prerequisite chain ('wiki_page needs the wiki page list (wiki_search once)'). It does not explicitly say when to prefer lua_inspect or lua_function_source over this, so it stops short of full alternative routing.

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