Skip to main content
Glama
johnhenry

mallory-grapher

by johnhenry

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MATH_GRAPHER_MAX_CELLSNoMaximum number of cells per session (default 512).512
MATH_GRAPHER_MAX_SESSIONSNoMaximum number of concurrent sessions (default 16).16
MATH_GRAPHER_EVAL_BUDGET_MSNoEvaluation budget in milliseconds (default 250).250
MATH_GRAPHER_MAX_PAYLOAD_BYTESNoMaximum payload size in bytes (default 262144).262144

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
session_openA

Open a reactive cell session. kind "generic" starts empty; "graph-theory" pre-wires an edge-list -> analysis -> BFS pipeline (input cells: edgeListText, directed, startVertex; computed cells: parsed, analysis, bfsOrder). Optional seed sets input cells in the same call (overriding preset defaults). Optional capabilities (issue #7) grants this session use of ops that declare a requiresCapability -- see session_define's own description for which ops (if any) need one; default none. Sessions are in-memory and die with the server.

session_closeB

Close a session and free its cells.

session_listA

List open sessions with kind, cell count, and creation time.

session_set_cellA

Set an input cell's value (any JSON). Setting a previously-computed cell demotes it to a plain input. Dependent computed cells recompute lazily on their next get.

session_get_cellB

Read a cell's current value (recomputing it if stale). Rich values project to typed JSON (a graph cell returns { "$type": "graph", vertices, edges, directed }).

session_list_cellsA

List every cell in a session with its role ("free" input vs "computed") and, for computed cells, the op that defines it.

session_snapshotA

Serialize a session's portable state (issue #6): current free-cell values plus define-specs. Does NOT include computed-cell cache -- those re-derive from define() on resume. Hand the returned document to session_resume, possibly on a different math-grapher process, to reconstruct an equivalent session.

session_resumeA

Reconstruct a session from a session_snapshot document. A resumed session is freshly opened, not re-authorized from wherever it paused -- every existing resource guard (session/cell/payload limits) applies exactly as it would to session_open, and capabilities (issue #7) are NOT carried forward from the original session: pass this call's own optional capabilities to grant any, default none.

session_explain_cellA

Explain a cell's own derivation (issue #5): its role (free input vs computed), the op and raw args that defined it (if computed), its immediate upstream cells with their current values, and its own current value. One level only -- call again on a listed dependency's "cell" name to go deeper.

session_defineA

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 }].

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.7/5.0

Scored across 10 tools

Disambiguation4/5

Session lifecycle tools and graph/math operations are mostly distinct, with clear boundaries between get, set, list, and explain cell operations. However, session_define lists catalog ops that are also exposed as standalone tools (math_eval, graph_*), which could confuse whether to invoke an op directly or via define.

Naming Consistency4/5

All tool names use snake_case with predictable prefixes: session_* for session lifecycle and graph_* for graph operations. Minor deviations like math_eval lacking a prefix and graph_bfs using an acronym rather than verb_noun keep it from perfect consistency.

Tool Count4/5

The actual tool list contains 16 tools (despite the stated count of 10), which is slightly above the 3-15 sweet spot. The set is still reasonably scoped for a reactive-cell session server with graph and math operations, and each tool covers a distinct lifecycle or op.

Completeness4/5

The surface covers session open/resume/snapshot/close/list, cell get/set/list/explain/define, and a useful graph/math op catalog. A few gaps exist, such as no explicit cell deletion or session update/capability modification after opening, but core workflows are supported.

Maintenance

ActivityMaintained
ResponsivenessResponsive