Skip to main content
Glama
johnhenry

mallory-grapher

by johnhenry

session_define

Define a reactive computed cell using catalog operations. Supports math evaluation, graph parsing, and graph analysis, with live cell references as dependencies.

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 a mallory-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
Behavior4/5

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

With no annotations, the description carries full burden. It discloses reactive dependencies via live cell references, explains each op's output format, and notes that graphs are opaque and must be projected via session_get_cell. It lacks explicit mention of overwrite semantics or failure modes, but for a define operation it provides solid transparency.

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 long but well-structured as a bulleted list of ops, each with args and value. It avoids fluff, front-loads the core purpose, and every sentence adds information. The length is justified by the breadth of operations; nothing is redundant.

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?

Given the tool's complexity (multiple ops, nested args, no output schema), the description is remarkably complete: it specifies all ops, their parameters, return shapes, and the reactive behavior. It lacks error handling or edge-case notes, but for an operation that defines computed cells, it provides sufficient detail for correct invocation.

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. It thoroughly explains 'op' and 'args' for each catalog operation, including argument structures and return types. However, 'sessionId' and 'cell' parameters are not explicitly described; sessionId is left to inferred context, and cell is only implicitly defined as the computed cell's name. Still, the heavy lifting for the most complex parameters is complete.

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 opens with a specific verb+resource: 'Define a computed cell from a catalog op.' It clearly distinguishes from siblings like session_set_cell (literal value) and session_get_cell (retrieve), and enumerates the exact operations available, leaving no ambiguity about what the tool does.

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?

The description implies usage for computed cells and details each op's arguments and return values, effectively guiding selection among ops. It does not explicitly contrast with session_set_cell for static values or state when this tool should not be used, but the context is clear enough for an agent to infer appropriate usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/johnhenry/mallory-grapher'

If you have feedback or need assistance with the MCP directory API, please join our Discord server