Skip to main content
Glama

Emit actor effect graph

emit_actor_effect_graph
Read-onlyIdempotent

Trace an actor's transitive effects—sends, awaits, spawns, schedules—and include its supervisors and tools to reveal all dependencies and reachable actors.

Instructions

Emit the actor/effect graph rooted at one actor: every actor reachable through Send, Await, Spawn, and Schedule effects (matched by message type), every supervisor of an included actor together with its whole child set, and every tool an included actor's effect summary names. Use it for 'what does this actor transitively do or depend on'; effect rows are per-process, so no single signature shows this. Use explain_actor_protocol for one actor's own interface and get_context_budget to gauge the size before requesting it. The reach spans the whole program: a row's type names resolve through the naming module's imports, so a sibling module's actors, supervisors, and tools are included and same-named declarations in two modules stay distinct. Returns schema_version (1), module (the root's), root, and the included actors, supervisors, and tools, whose nodes share the shape of hird emit-effect-graph --json plus a module tag; declarations the root does not reach are omitted. 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 root 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
rootYes
toolsYes
actorsYes
moduleYes
supervisorsYes
schema_versionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • changedInput schema / properties / actor_name / description
      Previous value: -"The root 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 root 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 root actor's name."New value: +"The root 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": {
      +    "actors": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "module": {
      +      "type": "string"
      +    },
      +    "root": {
      +      "type": "string"
      +    },
      +    "schema_version": {
      +      "type": "integer"
      +    },
      +    "supervisors": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "tools": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "actors",
      +    "module",
      +    "root",
      +    "schema_version",
      +    "supervisors",
      +    "tools"
      +  ],
      +  "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
Behavior5/5

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

Beyond the readOnly/idempotent/destructive annotations, the description discloses in-memory compilation with caching, no writes or execution, whole-program reach, module-qualified name resolution, and stable error.code values with diagnostic shapes. Nothing is hidden and nothing contradicts the 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?

The definition is front-loaded with the action and scope, and each block (use case, alternatives, reach, output shape, safety, errors) earns its place. It is longer than typical descriptions, but justified by the tool's cross-module semantics and error-handling complexity; a slight trim of the output-shape and error enumeration would improve it.

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 complex graph tool with only two parameters, the description covers invocation trigger, output shape, cross-module behavior, read-only guarantees, and error modes. An agent has enough context to decide when to call it, invoke it correctly, and interpret failures.

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?

The input schema already covers both parameters at 100%, including path resolution and actor qualification rules, so the baseline is 3. The description reinforces the meaning of the root/module and failure behavior but does not materially add new parameter-level semantics beyond the schema.

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 first sentence names a specific verb/resource ('Emit the actor/effect graph rooted at one actor') and specifies exactly what nodes are included: reachable actors, supervisors with children, and tools. It also distinguishes itself from explain_actor_protocol and get_context_budget by naming alternatives, so an agent can tell the tools apart.

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?

It gives an explicit trigger: use it for 'what does this actor transitively do or depend on' and explains why (per-process effect rows hide transitive reach). It also tells the agent to use explain_actor_protocol for a single actor's interface and get_context_budget to gauge size before requesting it. This is clear routing among siblings.

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