Skip to main content
Glama
casino-mcp

casino-mcp

casino-mcp

PyPI Python CI Licence

Un plano de control MCP sobre el código de Monte Carlo cuántico CASINO en Fortran: iniciar ejecuciones, saber qué se está ejecutando, detenerlas y leer un archivo out como datos estructurados en lugar de enviar 4000 líneas de texto al contexto de un modelo.

Beta (0.2.0). Las cuatro herramientas de control y el analizador de out están terminados y probados contra un CASINO real; la herramienta que devuelve física al modelo aún no se incluye. Las interfaces pueden cambiar antes de la 1.0.

Qué es y qué no es

CASINO ya tiene las primitivas — opt_plan, runqmc --auto-continue, multirun, envmc, make_E_v_dt. Lo que no tiene es la capa intermedia: resultados legibles por máquina, un registro de lo que se ejecutó y las decisiones de criterio que se sitúan entre los pasos («¿ha alcanzado la varianza una meseta?», «¿sigue este paso temporal en el régimen lineal?»). Esa capa es lo que es este paquete, y tres reglas lo mantienen honesto:

  1. Ningún número es producido por el modelo. Cada valor que devuelve una herramienta se lee de un archivo y lleva consigo la línea de la que proviene. Lo que CASINO no imprimió vuelve como null con un motivo, nunca una suposición.

  2. Cada resultado es reproducible a partir de su registro. Un registro de trabajo congela el comando, el número de procesos y la ruta, el tamaño y el mtime del binario casino que se ejecutó.

  3. Nada destructivo es implícito. Una ejecución se niega a iniciarse en un directorio que ya contiene resultados, y se niega con más firmeza cuando ese out son datos de referencia confirmados.

Deliberadamente no existe una herramienta execute_shell(command). Cada herramienta es una operación CASINO con nombre y argumentos tipados.

Related MCP server: qe2mcp

Instalación

pip install casino-mcp          # needs Python 3.11+ and a working CASINO installation

Desde un checkout:

pip install -e '.[dev]'

El paquete no incluye, compila ni sustituye a CASINO. Maneja runqmc, que sigue siendo el runtime: la detección de arquitectura, las variantes MPI, el envío a colas de trabajos y el archivo de bloqueo son su trabajo, no el nuestro.

Regístralo con Claude Code

.mcp.json, alcance del proyecto:

{
  "mcpServers": {
    "casino": {
      "command": "casino-mcp",
      "args": ["serve"],
      "env": {
        "CASINO_HOME": "/home/you/bin/CASINO",
        "CASINO_ARCH": "linuxpc-gcc-parallel.openblas"
      }
    }
  }
}

Herramientas

herramienta

devuelve

casino_run(workdir, nproc, version, restart, resume, unlock)

job_id, pid, workdir, command, sello del binario, qué eliminó restart

casino_status(job_id)

running / finished / failed / stopped / unknown, pid, tiempo de ejecución, código de salida

casino_stop(job_id, timeout)

qué señal se envió, estado final, qué hizo haltqmc

casino_list_jobs(limit)

todos los trabajos conocidos, primero los más recientes

El runtype (vmc, vmc_opt, vmc_dmc, …) proviene del archivo input en workdir; no hay una herramienta por runtype, porque eso multiplica la superficie sin añadir una capacidad.

Iniciar, detener y continuar un cálculo pasan todos por los propios scripts de CASINO, y solo por ellos: runqmc inicia, haltqmc finaliza y limpia, runqmc --continue o un runqmc simple sobre el input que haltqmc -u reescribió continúa. Nada de aquí mueve un archivo de configuración, edita un input o decide qué debería hacer a continuación un cálculo a medio terminar.

Un directorio que ya contiene un out

runqmc añade al final de out, vmc.hist y dmc.hist en lugar de reemplazarlos, así que ejecutar dos veces en un mismo directorio produce archivos que son dos ejecuciones pegadas. Eso está rechazado por defecto, y hay dos formas de evitarlo — opuestas, así que pasa una:

restart=true

elimina lo que dejó la ejecución anterior y empieza de nuevo. out, out_part.N, los archivos .hist, config.in/config.out, correlation.out.N, parameters.N.casl, saved_part_N/. Las entradas permanecen: input, la función de onda, los pseudopotenciales, correlation.data, parameters.casl. Cada nombre eliminado vuelve en la respuesta, bajo removed.

resume=true

continúa la ejecución interrumpida desde donde se detuvo. Cuál de las dos rutas de continuación de CASINO se toma se lee de out, no se elige aquí — ver más abajo.

En la línea de comandos son --restart y --resume, y --continue se acepta para esto último, que es como runqmc lo llama. El parámetro de la herramienta no puede escribirse así: continue es una palabra clave de Python.

Detener una ejecución y continuarla

casino_stop envía SIGTERM a los procesos casino de ese trabajo y a nada más — la misma señal que envía haltqmc -k, excepto que la de haltqmc es un pkill -x casino sobre toda la cuenta, lo que derribaría cualquier otro trabajo de la máquina. mpirun pone cada rango en su propio grupo de procesos, así que los rangos se encuentran por el id de sesión: la sesión es la del lanzador y todo el árbol la comparte. runqmc en sí se deja vivo para terminar su epílogo, y solo un trabajo que siga en ejecución después de timeout recibe la señal en su grupo de procesos y luego es eliminado.

Luego el directorio pasa por haltqmc -f -u, que es la parte que hace que una ejecución detenida pueda continuarse: config.out se convierte en config.in, los archivos de bloqueo y marcador desaparecen, e input se reescribe para el trabajo que queda — newrun : F, los bloques terminados restados, el runtype avanzado a la siguiente etapa. La respuesta incluye lo que hizo bajo halt. El input tal como estaba antes de eso se copia en el directorio del trabajo, y halt.input_saved indica dónde.

La ruta de continuación que toma entonces resume=true la decide la última ejecución en out:

CONTINUATION INFO: en out

runqmc --continue. CASINO escribe ese bloque solo cuando se detiene por max_cpu_time o max_real_time; runqmc lo aplica y archiva el segmento terminado en saved_part_N/.

no existe ese bloque

un runqmc simple sobre el input que haltqmc reescribió. Así es como continúa una ejecución interrumpida — --continue solo produciría un errstop por la información de continuación ausente.

la ejecución llegó a su propio final

rechazado: no hay nada que continuar.

restart=true se rechaza en un directorio cuyo input dice newrun : F, porque reiniciar elimina el config.in que CASINO entonces exige. Restaura primero el input guardado.

Línea de comandos

El mismo runtime sin un modelo en el bucle — que es también cómo se depura el servidor:

casino-mcp config                  # the resolved configuration, and the files it came from
casino-mcp run ./calc -p 4         # start a calculation
casino-mcp run ./calc --restart    # ... after deleting what an earlier run left there
casino-mcp run ./calc --continue   # ... or carrying that run on instead
casino-mcp status 20260823-164511-qobn
casino-mcp stop   20260823-164511-qobn   # stop the run, then hand the directory to haltqmc
casino-mcp jobs                    # the registry, newest first
casino-mcp parse ./calc            # the `out` file as JSON
casino-mcp serve                   # the MCP server on stdio

Cada subcomando imprime JSON y sale con código distinto de cero cuando ese JSON contiene un error.

Configuración

No hay archivo de configuración. Un servidor MCP se configura donde se registra — el bloque env del .mcp.json anterior — y las propias variables de CASINO conservan sus nombres, así que configurarlas una vez configura ambas capas:

variable

CASINO_HOME

raíz de la instalación de CASINO (por defecto ~/bin/CASINO)

CASINO_ARCH

objetivo de compilación, el directorio bajo bin_qmc; se usa para dejar constancia de qué binario ejecutó un trabajo

CASINO_RUNQMC

ruta explícita a runqmc; si no, PATH, luego $CASINO_HOME/bin_qmc/runqmc

CASINO_HALTQMC

ruta explícita a haltqmc; si no, PATH, luego $CASINO_HOME/bin_qmc/haltqmc

CASINO_MCP_STATE_DIR

el registro de trabajos; si no, $XDG_STATE_HOME/casino-mcp

CASINO_MCP_FORBID

directorios que ninguna ejecución puede tocar jamás, separados por : como PATH

Todo lo demás — un proceso MPI, el binario opt, veinte segundos para que un trabajo detenido termine por sí solo, un minuto para que haltqmc limpie, doscientos registros de trabajo conservados — es una constante en settings.py. casino-mcp config imprime lo que el servidor usaría ahora mismo y qué variable lo indicó; ejecútalo primero cuando una llamada a una herramienta se rechace.

CASINO_MCP_FORBID es la única protección sin anulación por llamada. restart=true/resume=true y unlock=true desbloquean las otras dos; un directorio listado aquí no se puede ejecutar en absoluto, que es lo que lo convierte en el lugar adecuado para un árbol de cálculos de referencia confirmados.

Cómo funciona

Claude Code ──stdio──> server.py ──spawn──> launcher.py ──> runqmc ──> mpirun ──> casino
                          │                     │
                          │                     └─ writes status.json (exit code, end time)
                          └─ reads/writes jobs.json + one directory per job

El estado reside fuera del cálculo, en $XDG_STATE_HOME/casino-mcp/:

jobs.json                    index: job_id -> record
jobs/<job_id>/meta.json      what was launched, frozen at spawn
jobs/<job_id>/status.json    written by the launcher when the run ends
jobs/<job_id>/runqmc.log     runqmc's own output (not CASINO's `out`)
jobs/<job_id>/input.before_halt   the input as it was, kept when a stop rewrites it

El directorio del cálculo solo recibe lo que CASINO pone ahí.

Por qué un proceso lanzador. runqmc es un script de bash que ejecuta mpirun -np N casino; enviar una señal a su pid deja huérfano al árbol. El lanzador se ejecuta en su propia sesión, que es lo que hace identificable al árbol — killpg alcanza a runqmc y mpirun, y el id de sesión encuentra los rangos que mpirun puso en grupos de procesos propios — su código de salida sobrevive al reinicio del servidor MCP, y la salida de runqmc va a un registro en lugar de al flujo JSON-RPC. Un pid reciclado no puede pasar por un trabajo vivo: se compara el tiempo de inicio de /proc/<pid>, y un zombi no cuenta como en ejecución.

El analizador de out

parse_out es una función simple sin MCP y sin dependencias. Un archivo out es una secuencia de fases, no un único resultado — vmc_opt escribe una fase VMC y una de OPTIMIZATION por ciclo, vmc_dmc escribe VMC, equilibración de DMC y acumulación de estadísticas de DMC — por lo que devuelve phases, y result apunta a la última fase que lleva una energía.

from casino_mcp.parse_out import parse_out

parsed = parse_out('./calc')
parsed['result']['energy']  # {'value': -2.861829862553, 'error': 0.000659077167, 'line': 237}

El único número derivado que contiene es el error de varianza muestral de una ejecución de un solo bloque, que CASINO no imprime; se toma del único bloque exactamente como hace envmc, y se etiqueta derived. Nada invoca envmc o endmc como subproceso en tiempo de ejecución — endmc malinterpreta los números con una configuración regional que no es C.

Pruebas

pytest                      # 158 tests, ~5 s, no CASINO needed

La suite de pruebas unitarias se ejecuta en cualquier lugar: el analizador se comprueba campo por campo contra cinco archivos out reales en tests/data/ — cada uno con el input que lo produjo — y sobre los dieciocho cálculos en examples/, mientras que el lanzador, el grupo de procesos y las salvaguardas se ejercitan contra un script de shell runqmc falso.

pytest -m integration

La suite de integración necesita un CASINO real, pero nada fuera de este repositorio. Comprueba parse_out contra el envmc propio de CASINO en cada out de examples/, vuelve a ejecutar todo el árbol contra el binario instalado, y maneja el servidor a través de MCP stdio real, ejecutando y deteniendo cálculos VMC reales.

examples/ contiene dieciocho cálculos elegidos como una cobertura de los ajustes con los que se puede ejecutar CASINO — cada tipo de ejecución, tipo de base, optimizador y opción de función de onda aparece al menos una vez, y también los dos archivos que un parser entiende mal silenciosamente: una ejecución que nunca imprimió una energía, y una interrumpida entre ciclos de optimización. examples/README.md explica para qué está cada uno.

Son cortos y con semilla, por lo que el árbol sirve también como comprobación del propio CASINO: vuelve a ejecutarlo en una nueva versión y cualquier línea que el parser lea y que haya sido renombrada o eliminada se nombra, en lugar de convertirse silenciosamente en un None. Solo eso se comprueba — los números movidos se notifican para que una persona los juzgue.

python tools/refresh_examples.py --nproc 4     # run the tree, report, touch nothing
python tools/refresh_examples.py --nproc 4 --write   # adopt the new output

tools/protocol_dump.py habla el JSON-RPC a mano, sin SDK, e imprime cada línea en ambas direcciones. Léelo antes de añadir una herramienta.

Licencia

MIT.

Available Tools

6 tools
casino_list_jobsC

Every known job, newest first, with its current state.

NameRequiredDescriptionDefault
limitNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description carries the full burden, but it does not state whether the operation is read-only or requires authentication. More importantly, it claims 'Every known job' while the schema shows a default limit of 20, suggesting the list is limited and not actually every job. This creates a transparency gap about the tool's real behavior.

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?

The description is a single, compact sentence with no wasted words. It front-loads the core subject ('Every known job') and delivers the key dimensions (order and state) efficiently. For a simple list tool, this is an ideal length and structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is incomplete for a tool with no annotations and an underspecified schema. It does not explain the limit parameter's effect, the read-only nature, or when to use it relative to siblings. Although an output schema exists, key operational context is missing, leaving an agent uncertain about how to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter, 'limit', has zero schema description coverage, and the description does not mention it at all. The description's phrase 'Every known job' actively obscures the fact that the limit parameter controls how many jobs are returned. The description provides no semantic help for the parameter.

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 description clearly indicates that the tool lists all known jobs with their current state, newest first. It implies a listing operation and distinguishes itself from siblings like casino_status or casino_results by covering all jobs rather than a specific one. It lacks a direct verb like 'list', but the intended 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 Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus the sibling tools. There is no mention of use cases, exclusions, or alternatives such as casino_status for a single job's status. The description only states what the tool does, not when to choose it.

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

casino_prepareA

Copy a calculation into a new directory and write the input for the next run in it.

This is how a calculation becomes the next one: optimise a wave function, then prepare a vmc_dmc directory beside it; halve the timestep into another; change the target weight into a third. A copy rather than an edit, because a number whose input was overwritten in place can no longer be reproduced, and because casino_run refuses a directory that already holds a run -- rightly.

What is copied is what a calculation is given and never what a run produced: input, the orbital file, correlation.data, parameters.casl, the pseudopotentials, and config.in (which a dmc-only or opt runtype reads as an input). Not out, not the .hist files, not config.out. A symlinked orbital file is copied by content, so the new directory stands on its own.

runtype: the runtype the new directory is for -- vmc, vmc_opt, opt, vmc_dmc, vmc_dmc_equil, dmc_dmc, dmc_equil, dmc_stats. Every keyword that runtype needs and the source input does not set is filled from a working default; every keyword the source does set is kept, so the electron count, the basis and any hand tuning survive. Leave it empty to keep the source's runtype and only apply overrides. overrides: keywords to set, as {name: value}, and they win over both the source and the defaults. A null value deletes the keyword; a value containing newlines is written as a %block (that is how opt_plan and npcell are set). Values are written verbatim, so booleans are 'T' and 'F' as CASINO spells them. jastrow: the terms of a blank Jastrow factor to write into the new directory -- ['u', 'chi', 'f'] for the usual one, ['u'] for a system with no atoms. This is for the first calculation of a chain, the one whose directory holds an orbital file and nothing else: use_jastrow : T needs a correlation.data, no CASINO utility writes one, and the manual's own instruction is to copy an example and delete its numbers by hand. Every coefficient starts at zero, which is what the first optimisation cycle is for. Leave it unset when the source already has a correlation.data; asking for both is refused, because a blank Jastrow would discard an optimised one. Finite systems only so far: a periodic Jastrow wants a P term, whose stars come from CASINO's own make_p_stars. backflow: the terms of a blank backflow function, in the same file -- ['eta', 'mu', 'phi'] for the usual one. It goes with backflow : T in the input, and the two blocks are written together for a calculation that wants both. The electron-nucleus cusp type of each set is not a setting: it is read off the pseudopotentials in the directory, 1 for a bare nucleus and 0 behind a pseudopotential, because CASINO believes the flag without checking it. No AE CUTOFFS section is written -- it is optional, and CASINO chooses the lengths itself. jastrow_settings: the shape of both blocks, where the defaults are not wanted. Jastrow: trunc_order (3), n_u (8), n_chi (8), n_f_en (3), n_f_ee (3), spin_dep_u (1), spin_dep_chi (0), spin_dep_f (1), cusp_chi (0), cutoff_u / cutoff_chi / cutoff_f (0, which CASINO reads as "use your own default"), no_dup_u (0), no_dup_chi (0), optimizable (1, the cutoffs). Backflow: bf_trunc_order (3), n_eta (9), n_mu (9), n_phi_en (3), n_phi_ee (3), spin_dep_eta (1), spin_dep_mu (0), spin_dep_phi (1), cutoff_eta / cutoff_mu / cutoff_phi (0), irrotational (0), cusp_bf (-1, meaning derive it from the pseudopotentials).

Nothing is written unless the result would actually run: the keyword combinations CASINO only rejects at run time are checked first (an optimisation sample smaller than the DMC target weight, opt_backflow without backflow, a missing mandatory keyword), and so is the presence of every file the input tells CASINO to read. A refusal names the problems and creates no directory. What is legal but probably unintended -- a dtdmc still at CASINO's placeholder default, dmc_stats_nstep not divisible by its block count, keywords left over from the runtype this was copied from -- comes back in warnings and does not stop it.

NameRequiredDescriptionDefault
destYes
sourceYes
jastrowNo
runtypeNo
backflowNo
overridesNo
jastrow_settingsNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description fully carries the behavioral burden: which files are copied, which are excluded, symlink handling, default filling, validation checks, refusal behavior, warnings, and precedence rules. This is exceptionally transparent.

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?

The description is long, but every paragraph earns its place given the domain complexity. It is front-loaded with purpose, then systematically covers file selection, parameters, and validation behavior without redundancy.

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 tool with no annotations, this description is complete: all parameters are explained, valid runtypes are enumerated, defaulting and overrides are specified, and refusal/warning behavior is disclosed. The presence of an output schema covers return-value specifics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 does so thoroughly: runtype values and defaults, overrides precedence and %block behavior, jastrow/backflow semantics, and jastrow_settings defaults. Even the required source/dest parameters are clear from 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?

The first sentence states the exact action: copy a calculation into a new directory and write the input for the next run. The workflow explanation and examples make it clearly distinct from sibling tools like casino_run or casino_status.

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 gives strong workflow context ('This is how a calculation becomes the next one') and concrete examples, and it explains why copying rather than editing is required because casino_run refuses a directory that already holds a run. It stops short of explicitly naming when-not-to-use alternatives such as 'use casino_run to execute instead'.

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

casino_resultsA

Physics out of a job's files: energies, error bars, variance, per-block numbers.

Reads out and returns it as phases, because a CASINO run is a sequence of them and not one result: vmc_opt writes a VMC and an optimization phase per cycle, vmc_dmc writes VMC, DMC equilibration and DMC statistics accumulation. result points at the number that is this run's answer, and every value carries the file and line it was read from. Nothing is computed here that CASINO did not print, and a value it did not print comes back as null with the reason.

A DMC run that has not ended is readable too, and this is the only way to read one: CASINO writes the mixed estimators into out at the very end, and until then the current estimate lives in dmc.status, which it rewrites after every statistics block and deletes when the run finishes. When that file is there it is parsed into dmc_status and result points at it, so a running job answers with the estimate as of its last block -- and never with the VMC energy of the configuration-generation phase, which is the trial wave function's and not the calculation's. A run stopped by casino_stop keeps its dmc.status, so the last estimate it reached survives the stop.

While the run is still equilibrating there is no DMC energy anywhere yet, and result then says so rather than answering with an earlier phase.

NameRequiredDescriptionDefault
job_idYes

Output Schema

NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly. It explains that values come from CASINO-printed data, that missing values return null with a reason, that running DMC results are read from dmc.status, that dmc.status is deleted on completion, and that casino_stop preserves the last estimate. This is rich, non-obvious behavioral context.

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 information-dense, with each paragraph covering a distinct behavioral area: output contents, phase semantics, running jobs, and equilibration. The structure is front-loaded with purpose and then deepens into edge cases. The awkward opening phrase 'Physics out of a job's files' slightly reduces clarity but does not waste space.

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?

Given that an output schema exists and the tool has only one parameter, the description is unusually complete. It covers completed runs, running DMC runs, stopped runs, equilibration, value provenance, and the meaning of `result`. An agent has enough context to invoke the tool correctly and interpret its results in most scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has one required parameter, job_id, with 0% schema description coverage, and the tool description never mentions job_id explicitly. It refers to 'a job's files' and 'this run,' but it does not explain how job_id selects the job, where to obtain valid job IDs, or any constraints. Because schema coverage is low, the description was expected to compensate and did not.

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 description states that the tool reads a job's `out` file and returns energies, error bars, variance, per-block numbers, and phases, which clearly identifies it as a results-reading tool. It also explains the `result` field as the run's answer, giving concrete purpose. It does not explicitly name sibling distinctions, but the resource and operations are clear.

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 description provides useful conditions for when this tool is appropriate, especially for running DMC runs, saying it is 'the only way to read one.' It also covers stopped runs and equilibration states. However, it never explicitly contrasts the tool with casino_status or casino_list_jobs, so alternative routing is only implied rather than stated.

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

casino_runA

Start a CASINO calculation in workdir and return immediately.

The runtype (vmc, vmc_opt, vmc_dmc, ...) comes from the input file in workdir; this tool only decides how the binary is launched. The calculation keeps running after the call returns and after this server is restarted.

A directory that already holds an out is refused, because runqmc appends to it and the result is two runs in one file. restart and resume are the two ways past that, and they are opposites -- pass one.

workdir: directory holding input and the wave function files. nproc: number of MPI processes (vmc_nstep in input is the total over all of them). version: binary flavour, 'opt' or 'debug'. restart: delete out and everything else the earlier run left -- .hist files, configs, optimisation output -- and start the calculation over. Inputs are kept. Destructive: config.in goes too, so what could have been continued no longer can be. Refused on a directory whose input haltqmc has set up to continue (NEWRUN : F), because CASINO then wants the config.in this would delete; casino_stop keeps a copy of the input as it was, and the reply to the stop says where. resume: carry the interrupted run on, keeping the work already done. Which of CASINO's two continuation routes that takes is read out of out, not chosen here: a run that CASINO stopped on max_cpu_time / max_real_time is continued by runqmc --continue, and a run that casino_stop halted is continued by a plain runqmc over the input that haltqmc -u rewrote. The reply says which one under resume. A run that reached its own end is refused -- there is nothing to continue. unlock: clear a stale .runqmc.lock left by a runqmc instance that died.

NameRequiredDescriptionDefault
nprocNo
resumeNo
unlockNo
restartNo
versionNoopt
workdirYes

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it delivers: it discloses that the calculation outlives the call and server restart, that `out` is appended to and can corrupt results, that restart is destructive to `config.in` and optimization output, and how resume behaves under different halting conditions. This is deep, honest behavioral disclosure.

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?

The description is long but every sentence earns its place. It is front-loaded with the core purpose, then organizes the non-obvious behavioral details and parameter semantics in a structured, scannable way. The density is justified by the tool's complexity and destructive options.

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?

Given a 6-parameter tool with no annotations, the description is exceptionally complete: it covers prerequisites, launch semantics, background persistence, destructive behavior, failure conditions, and parameter interactions. The presence of an output schema relieves it from detailing return values, so nothing critical is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 thoroughly. Every parameter — workdir, nproc, version, restart, resume, unlock — gets meaningful explanation beyond its name, including relationships like nproc counting total vmc_nstep, version being a binary flavour, and the precise effects of restart versus resume.

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 precise verb and resource: 'Start a CASINO calculation in workdir and return immediately.' It clarifies that the runtype comes from the input file and that this tool only controls binary launch, making it easy to distinguish from siblings like casino_prepare, casino_status, and casino_stop.

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?

It gives strong when-to-use and when-not-to-use guidance: directories with existing `out` are refused, restart and resume are opposites, resume is refused for completed runs, and restart is refused when NEWRUN : F is set. It does not explicitly name sibling alternatives for common flows, but the contextual sibling list makes the intended role clear.

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

casino_statusA

State of one job: running / finished / failed / stopped, pid, runtime in seconds, exit code.

NameRequiredDescriptionDefault
job_idYes

Output Schema

NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are present, so the description must carry the behavioral burden. It does disclose the status vocabulary and returned metrics, and 'state of one job' strongly implies a read-only query. However, it does not explicitly state that it has no side effects, how unknown or expired job IDs are handled, or whether it is safe to poll repeatedly.

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?

The description is a single sentence with no filler. It front-loads the core scoping ('State of one job') and then lists the concrete status and metric fields, so every word adds value.

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 low-complexity one-parameter status query, the description is largely complete: it defines the job scope and the returned state fields, and the output schema covers the return contract. The main omissions are explicit usage routing and side-effect disclosure, but the tool is simple enough that the given information allows a correct call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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 add meaning to job_id. It adds minimal context by indicating the parameter refers to the specific job whose state is checked, but it does not mention job_id by name, explain how to obtain a valid value, or provide any format guidance beyond the schema's string type.

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 description clearly identifies the tool as reporting the state of a single job and enumerates the key fields returned (status, pid, runtime, exit code). The phrase 'one job' helps separate it from casino_list_jobs, but it does not explicitly contrast with casino_results or other siblings.

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 rather than stated: an agent can infer that this tool is for checking an individual job's status after invoking casino_run. There is no explicit guidance about when to use it instead of casino_results, casino_stop, or casino_list_jobs, and no mention of prerequisites such as having a valid job_id.

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

casino_stopA

Stop a running calculation and leave its directory ready to be continued.

SIGTERM goes to this job's casino processes, as haltqmc -k does for the whole account, so runqmc stays alive to finish writing out. CASINO has no graceful-halt signal: the blocks it had finished stay in out, vmc.hist and dmc.hist, the current block is lost. Then haltqmc -f -u tidies the directory -- config.out to config.in, the lock file, and input rewritten for the work that is left -- so casino_run(workdir, resume=true) carries this calculation on.

timeout: seconds the job gets to end on its own before the process group is killed.

NameRequiredDescriptionDefault
job_idYes
timeoutNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and succeeds. It details that SIGTERM targets the job's casino processes, that runqmc survives to write output, that the current block is lost, and that haltqmc -f -u tidies the directory for resumption. It also explains the timeout fallback behavior.

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?

The description is front-loaded with the core purpose and then adds only high-signal behavioral details. Every sentence contributes meaningful operational knowledge without repetition or filler.

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 side-effect-heavy tool with no annotations, the description is remarkably complete: it covers signal behavior, persistence of completed data, loss of current block, directory cleanup, resumption path, and timeout semantics. An output schema is present, so explaining return values is not necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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 fully explains timeout as the seconds a job gets before its process group is killed, but job_id is left to its schema title and the contextual phrase 'running calculation.' The main parameter is not explicitly defined or sourced.

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 and resource: 'Stop a running calculation and leave its directory ready to be continued.' This clearly distinguishes casino_stop from the sibling tools casino_run, casino_prepare, casino_status, casino_results, and casino_list_jobs.

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 clearly establishes the tool's purpose for stopping a running calculation and contrasts it with haltqmc -k's account-wide behavior, implying this tool is job-scoped. It does not explicitly enumerate when to use it over siblings, but the intended use is unambiguous in context.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.4.0
    • First observedcasino_list_jobs
    • First observedcasino_prepare
    • First observedcasino_results
    • First observedcasino_run
    • First observedcasino_status
    • First observedcasino_stop

TDQS

A3.9/5.0

Scored across 6 tools

Disambiguation5/5

Each tool addresses a distinct lifecycle stage: preparing a directory, launching/interrupting a run, listing/checking jobs, and extracting physics results. Status and list_jobs are adjacent, but one is explicitly per-job detail while the other is an overview, so there is no real ambiguity.

Naming Consistency4/5

All tools share the casino_ prefix and use snake_case, but the pattern mixes simple verbs (run, prepare, stop), a verb-object phrase (list_jobs), and bare nouns (status, results). This is readable and predictable, though not a uniform verb_noun convention.

Tool Count5/5

Six tools is a well-scoped set for a job-management server. Each tool covers a necessary action without redundancy, and the count sits comfortably in the ideal 3-15 range.

Completeness5/5

The tool surface covers the full CASINO workflow: prepare a calculation, run or restart it, monitor it, stop it, and retrieve physics results. Missing cleanup or job-forgetting operations are not essential to the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Converts Quantum ESPRESSO output files to structured JSON and serves them via an HTTP API for use with MCP clients.
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Durable MCP server for managing long-running jobs locally, over SSH, or on Slurm clusters. Jobs survive client disconnects and return exit codes, bounded logs, and JSON artifacts.
    11
    1
    MIT