Skip to main content
Glama

solve_wave_1d

Solve the 1D wave equation u_tt = c^2 u_xx with explicit central differences, enforcing the Courant condition and supporting Dirichlet, Neumann, and Robin boundary conditions.

Instructions

Solve u_tt = c^2*u_xx with explicit central differences.

``initial_displacement`` and ``initial_velocity`` are expressions in ``x``.
The Courant condition c*dt/dx <= 1 is enforced. Each of ``left``/``right``
is either a float (Dirichlet displacement) or a dict:
``{"type": "dirichlet", "value": v}``,
``{"type": "neumann", "flux": q}`` or
``{"type": "robin", "h": h, "ambient": a}``; boundary conditions act on the
displacement. ``flux`` is du/dx at the boundary (not the outward-normal
derivative): the left outward normal is -x so its outward-normal derivative
is -flux, while the right end's is +flux. Robin means
``h*(u - ambient) + du/dx = 0`` at both ends with the same x-derivative
convention (unit conductivity k). Neumann/Robin ends use ghost
nodes, with Robin applied at the new time level for stability at large h.
The full grid is saved as .npz, while the returned arrays are downsampled
to at most 100 spatial and 50 time points.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cYes
ntYes
nxYes
leftNo
rightNo
t_endYes
lengthYes
initial_velocityNo0
initial_displacementYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses the enforced Courant condition, the ghost-node treatment, that Robin is applied at the new time level for stability, that the full grid is saved as .npz, and that returned arrays are downsampled to 100x50. It omits error behavior and runtime/performance traits, keeping it short of a 5.

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 equation and method, then proceeds to the boundary-condition detail. The flux/ghost-node discussion is dense and technical but each clause conveys real calling information; sizing is appropriate for a numerical solver.

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?

With no annotations and no output schema, the description still covers the return format (downsampled arrays, npz grid), the stability constraint, and the full boundary-condition vocabulary, which is what an agent needs to call it correctly. Minor gaps remain around array names and output file paths.

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% across 9 parameters, so the description must compensate. It richly documents the ambiguous ones (left/right dict forms, boundary conventions, initial_displacement/initial_velocity as expressions in x, the flux sign convention), though c, length, nx, nt, and t_end are left to be inferred from the equation context.

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?

States a specific verb ('Solve') plus the exact governing equation (u_tt = c^2*u_xx) and the numerical method (explicit central differences). This clearly distinguishes it from siblings like solve_heat_1d, solve_burgers_1d, and solve_wave_3d without needing to open the schema.

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?

The stated PDE implies when the tool applies, but there is no explicit guidance on when to choose this over solve_wave_3d, solve_pde_1d, or solve_burgers_1d, and no stated prerequisites or exclusions. Usage is inferable rather than directed.

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