Skip to main content
Glama

Solve the heat equation

singularis_solve_heat
Idempotent

Solve the heat (diffusion) equation on 1D or 2D grids, advancing an initial field over time with periodic, Neumann, or Dirichlet boundaries; returns final field and accuracy checks.

Instructions

Solve the heat (diffusion) equation u_t = D * laplacian(u) on a 1D or 2D grid, stepping an initial field forward in time; the same equation prices options after a change of variables (Black-Scholes) and models thermal spread. Use instead of writing a stencil loop whenever steps * cells is large. Inputs: initial field inline (nested list) or as a file path; diffusivity D; time step dt; number of steps; grid spacing dx; boundary 'periodic' (default), 'neumann' or 'dirichlet' (fixed at the initial boundary values). Returns the final field (inline or as a .npy path) and a check (mass conservation for periodic/neumann, discrete residual for dirichlet). Cost scales with steps * cells.

Input Schema

NameRequiredDescriptionDefault
dtNo
dxNo
pathNo
stepsNo
initialNo
boundaryNoperiodic
diffusivityNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.4/5.0
Behavior4/5

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

With annotations covering safety (readOnlyHint=false, destructiveHint=false, idempotentHint=true), the description adds real behavioral context: what is returned (final field inline or .npy path, plus a conservation/residual check), what each boundary mode does, and that cost scales with steps * cells. It does not flag stability constraints (e.g., dt vs dx^2/D), which a diffusion solver needs.

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?

Front-loaded with the governing equation and scope, then inputs, then returns, then cost — a sensible order. The Black-Scholes aside and repeated 'inline or as a file path' phrasing are slight padding, but the text is dense and earns most of its length.

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 7-parameter numeric solver with an output schema, the description covers inputs, boundary semantics, return shape, verification check, and cost profile. Since the output schema covers return structure, the extra return detail is a bonus rather than a gap; nothing needed to call it correctly is missing.

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 description coverage is 0%, so the description must compensate, and it does: it enumerates every parameter (initial field inline or file path, diffusivity D, dt, steps, dx, boundary) and even supplies the boundary enum values ('periodic' default, 'neumann', 'dirichlet' fixed at initial values) that the schema lacks. It omits units/ranges or stability guidance for dt and dx.

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?

Names a specific verb and resource (solve the heat/diffusion equation u_t = D*laplacian(u)) and states the scope (1D/2D grid, time stepping). Sibling tools are all linear-algebra/utility primitives (fft, gemm, matrix_exponential) with no competing PDE solver, so the purpose is unambiguous.

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?

"Use instead of writing a stencil loop whenever steps * cells is large" gives an explicit alternative and threshold for choosing this tool, and the Black-Scholes remark adds a second legitimate use case. It stops short of stating when NOT to use it (e.g., small grids or non-diffusive PDEs).

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