Skip to main content
Glama

Explain actor protocol

explain_actor_protocol
Read-onlyIdempotent

Describe an actor's protocol: message constructors, state type, init params, and per-handler effect rows. Use it to learn how to talk to an actor or what each handler may do.

Instructions

Describe one actor's protocol: its message type and constructors, state type, init parameters and effects, per-handler effect rows, and the declared effect summary. Use it to learn how to talk to an actor or what each handler may do; use emit_actor_effect_graph for the actors, supervisors, and tools it reaches transitively, and lookup_definition if you only need its location. Returns actor with name, line, state, message (name, constructors), init (params, effects), handlers (message, effects), and effects; types and rows carry a display string. actor_name resolves like any symbol: a local actor, a selectively imported one, or Qualifier.name through a use; module and file name the defining module. Read-only: compiles the file's directory in memory (cached until a sibling changes) and writes or executes nothing. Failures are isError results with a stable error.code: file_not_found, read_error, invalid_params, and, for every tool but check_file, parse_error or check_error carrying coded diagnostics in error.data.diagnostics (the shape check_file returns).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to a .hird source file, absolute or relative to the server's working directory. Every .hird file in its directory is compiled with it as one program, so imported names resolve; answers may name a sibling file.
actor_nameYesThe actor's name, as the file would write it (`Planner`, `Fleet.Planner`): a local actor, or a sibling module's as `Qualifier.name` through `use Mod` (or `Module.name` for any module of the program). An unknown name fails with `not_found` and `error.data.available_actors`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYes
actorYes
moduleYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • changedInput schema / properties / actor_name / description
      Previous value: -"The actor's name, as declared in this file. Actors are not resolved through imports; an unknown name fails with `not_found` and `error.data.available_actors`."New value: +"The actor's name, as the file would write it (`Planner`, `Fleet.Planner`): a local actor, or a sibling module's as `Qualifier.name` through `use Mod` (or `Module.name` for any module of the program). An unknown name fails with `not_found` and `error.data.available_actors`."
  2. Changed4 schema fields changed
    • changedInput schema / properties / actor_name / description
      Previous value: -"The actor's name."New value: +"The actor's name, as declared in this file. Actors are not resolved through imports; an unknown name fails with `not_found` and `error.data.available_actors`."
    • changedInput schema / properties / file / description
      Previous value: -"Path to a .hird source file. Its directory's .hird files are compiled together as one program, so imported names resolve."New value: +"Path to a .hird source file, absolute or relative to the server's working directory. Every .hird file in its directory is compiled with it as one program, so imported names resolve; answers may name a sibling file."
    • changedInput schema / required
      Previous value: -[
      -  "file",
      -  "actor_name"
      -]New value: +[
      +  "actor_name",
      +  "file"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "actor": {
      +      "properties": {
      +        "effects": {
      +          "description": "An effect row: `effects` (each with `head`, `args`, `display`), an optional `tail` row variable, and its `display` string.",
      +          "type": "object"
      +        },
      +        "handlers": {
      +          "type": "array"
      +        },
      +        "init": {
      +          "type": "object"
      +        },
      +        "line": {
      +          "type": "integer"
      +        },
      +        "message": {
      +          "type": "object"
      +        },
      +        "name": {
      +          "type": "string"
      +        },
      +        "state": {
      +          "description": "A type, with its `display` string as Hirð prints it.",
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "name",
      +        "line",
      +        "state",
      +        "message",
      +        "init",
      +        "handlers",
      +        "effects"
      +      ],
      +      "type": "object"
      +    },
      +    "file": {
      +      "type": "string"
      +    },
      +    "module": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "actor",
      +    "file",
      +    "module"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changedv0.1.1
    • changedInput schema / properties / file / description
      Previous value: -"Path to a .hird source file."New value: +"Path to a .hird source file. Its directory's .hird files are compiled together as one program, so imported names resolve."
  4. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

The description goes beyond annotations (which only state read-only, idempotent, non-destructive) to disclose that the tool compiles the file's directory in memory with caching, writes/executes nothing, and returns failures with stable error codes. It also details the error code taxonomy and the shape of diagnostics. This is rich additional behavioral context. It does not contradict annotations, and it adds value by specifying the compilation behavior and error handling.

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 substantial but well-structured: it starts with the primary purpose and immediate alternatives, then provides return structure, parameter resolution, and error behavior. It earns its length by packing essential information. It is not excessively verbose; each sentence contributes to understanding. However, it could be slightly more front-loaded by placing the alternatives earlier, but the current order is logical.

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?

Given the tool's complexity (rich output structure, error handling, parameter resolution rules), the description covers everything an agent needs: return shape, resolution semantics, error codes, and side-effect-free behavior. The output schema exists, but the description still explains the meaning of the fields and the error data, making it complete for correct invocation and interpretation.

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 baseline is 3. The description adds meaning by explaining how `actor_name` resolves (local, imported, qualified) and the effect of `file` (compiling the whole directory). It also details the return structure including the `display` string for types and rows, and failure conditions. This goes beyond a simple restatement of parameter definitions, but since the schema already describes each parameter thoroughly, the additional value is moderate.

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 clearly states the tool's purpose: to describe an actor's protocol, enumerating the specific components (message type, state type, init effects, per-handler effects, effect summary). It uses a specific verb ('Describe') and resource ('actor's protocol'), and distinguishes itself from siblings like 'emit_actor_effect_graph' and 'lookup_definition' by naming them and stating their alternative purposes.

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

Usage Guidelines5/5

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

The description explicitly says when to use this tool: 'Use it to learn how to talk to an actor or what each handler may do'. It also gives clear alternatives: 'use `emit_actor_effect_graph` for transitive actors/supervisors/tools' and 'use `lookup_definition` if you only need its location'. This provides both when-to-use and when-not-to-use guidance.

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