Skip to main content
Glama
johnhenry

mallory-grapher

by johnhenry

session_define

Build a reactive computed cell from catalog operations; literal values or live cell references become dependencies that trigger recomputation when source cells change.

Instructions

Define a computed cell from a catalog op. args values may be literal JSON or live cell references ({"$cell": "name"}) -- referenced cells become reactive dependencies, so the cell recomputes when they change. Available ops:

  • math_eval: Evaluate an @johnhenry/math Symbolic expression string over named numeric variables. args: { expr: string, vars?: { name: number | {"$cell": ...} } }. value: number.

  • graph_parse_edge_list: Parse a from to [weight]-per-line edge list into a graph value. args: { text: string, directed?: boolean (default true) }. value: graph (opaque; project with session_get_cell).

  • graph_analyze: Structural analysis of a graph cell. args: { graph: graph }. value: { hasCycle, connectedComponents, stronglyConnectedComponents, topologicalOrder, adjacencyMatrix: { matrix, order } }.

  • graph_bfs: Breadth-first traversal order. args: { graph: graph, start: string }. value: string[].

  • graph_dfs: Depth-first traversal order. args: { graph: graph, start: string }. value: string[].

  • graph_dijkstra: Dijkstra shortest-path distances from a start vertex. args: { graph: graph, start: string }. value: [{ vertex, distance }].

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYes
argsYes
cellYes
sessionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does disclose a genuine behavioral trait: referenced cells become reactive dependencies so the cell recomputes on change. It also lists per-op return types. It omits error behavior for invalid ops and whether redefining overwrites an existing cell.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core reactive-args rule, then a tight per-op bullet list pairing args with produced value types. Dense but every line earns its place; 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?

For a six-op dispatcher with no output schema and no annotations, the description supplies args and return shapes per op plus reactivity semantics, which is substantial. Remaining gaps are sessionId semantics, failure modes for bad ops, and overwrite behavior on redefine.

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%, so the description must compensate, and it largely does: it enumerates every legal 'op' value with its 'args' shape, and explains the {'$cell': ...} reference syntax for args. However 'sessionId' and the 'cell' naming semantics are never explained.

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 opening line gives a specific verb+resource ('Define a computed cell from a catalog op') and the op catalog makes the scope concrete. It does not explicitly distinguish itself from close siblings like session_set_cell or session_get_cell, so an agent must infer the boundary.

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?

Usage is implied by the op catalog rather than stated: no when-to-use/when-not guidance and no comparison against session_set_cell. The one real routing hint is 'project with session_get_cell' for opaque graph values, which points to a sibling but only for that narrow case.

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