guideStart here
How to call each tool: inputs, declarations, output layers, limits. Not counted as a call.
Connect through MCP to put mathematical checks inside your AI workflow. Your assistant submits a model, reads the evidence, and verifies its next revision.
Use the hosted engine, or run a local copy in your own environment.
In your AI client, add an MCP server named ANANKE. Choose Streamable HTTP and use this server URL.
https://ananke.lbyos.com/mcpThis is ANANKE's hosted MCP endpoint. Your client must support remote MCP.
For clients that accept an mcpServers configuration. Field names can differ by client; the server URL and header stay the same.
{
"mcpServers": {
"ananke": {
"url": "https://ananke.lbyos.com/mcp"
}
}
}Create an API key in the console. Send your key as X-API-Key over HTTP. Keyed calls count toward your account's usage.
Reconnect your client and confirm that verify_model appears in its tools. Then send this prompt to your assistant.
Use ANANKE's verify_model tool to check this model:
{
"equations": [
"dA/dt = -k*A",
"dB/dt = k*A"
],
"states": [
"A",
"B"
],
"anchors": {
"A": "nM",
"B": "nM",
"k": "1/hr",
"t": "hr"
},
"closed_system": true
}
Report each check separately: its result, whether it ran, its assumptions, and its evidence.
If a declaration is missing, ask me before adding it. Do not treat an undecided check as a pass.
If you propose a correction, show the change and verify the revised model again.Expect a result for each applicable property. A missing sign or other declaration may leave a check undecided. Ask for the premise; don't invent one to get a pass.
For a supported source format, call translate_model first. Inspect the echoed input and pass its entire canonical object to verify_model, including its IR and declarations.
Send your model file's text to translate_model. This example preserves the ODEs, default parameter values, initial amounts and captured concentration. Add a finite dosing schedule when you want to include bolus doses or infusions. No simulation is run.
{
"format": "mrgsolve",
"anchors": {
"GUT": "mg",
"CENT": "mg",
"CL": "L/hr",
"V": "L",
"KA": "1/hr",
"t": "hr"
},
"arithmetic": "exact_decimal",
"initial_time": "0",
"body": "$PROB Oral one-compartment PK\n$PARAM CL=1, V=20, KA=1\n$INIT GUT=100, CENT=0\n$MAIN\ndouble ke = CL/V;\n$ODE\ndxdt_GUT = -KA*GUT;\ndxdt_CENT = KA*GUT - ke*CENT;\n$TABLE\ncapture CP = CENT/V;"
}Choose exact mathematical arithmetic and anchor initial values at time zero. Supply units with the import so they are part of the returned model. Review that complete model before verification. Unsupported blocks or C++ statements return an import error with no partial model to verify.
This example imports a pure C++ function, three infusions, individual variation and observation error. Review the expanded schedule and the random-effect declarations in the response.
{
"format": "mrgsolve",
"arithmetic": "exact_decimal",
"initial_time": "0",
"anchors": {
"CENT": "mg",
"CL": "L/hr",
"V": "L",
"t": "hr",
"mrgETA1": "1",
"mrgEPS1": "1"
},
"dosing": [
{
"time": "0",
"amt": "100",
"cmt": 1,
"rate": "10",
"ii": "24",
"addl": 2
}
],
"body": "$PROB Repeated infusion with individual variation and observation error\n$GLOBAL\ndouble clearance(double typical, double eta) {\n return typical*exp(eta);\n}\n$PARAM CL=1, V=20\n$CMT CENT\n$OMEGA 0.1\n$SIGMA 0.01\n$MAIN\ndouble cli=clearance(CL,ETA(1));\n$ODE\ndxdt_CENT=-cli*CENT/V;\n$TABLE\ncapture DV=(CENT/V)*(1+EPS(1));"
}In this example, ETA is fixed for an individual and EPS belongs to the current observation record. Covariance checks do not prove every population property. Explicit resampling uses the complete record schedule shown below.
Select one patient from idata and supply a complete data calendar. This example expands PKMODEL into amount equations, initializes a stable linear model at its exact steady-dose target, and applies a later clearance update. With nocb: false, the previous clearance is held until the next record.
{
"format": "mrgsolve",
"arithmetic": "exact_decimal",
"initial_time": "0",
"anchors": {
"CENT": "mg",
"CL": "L/hr",
"V": "L",
"t": "hr"
},
"subject_id": 2,
"idata": [
{
"ID": 1,
"CL": 1,
"V": 20
},
{
"ID": 2,
"CL": 2,
"V": 25
}
],
"data": [
{
"ID": 2,
"TIME": 0,
"CL": 2,
"EVID": 1,
"AMT": 100,
"CMT": 1,
"II": 12,
"SS": 1
},
{
"ID": 2,
"TIME": 12,
"CL": 1.5,
"EVID": 1,
"AMT": 100,
"CMT": 1
}
],
"nocb": false,
"body": "$PROB One selected patient with steady-dose initialization\n$PARAM CL=1, V=20\n$CMT CENT\n$PKMODEL ncmt=1\n$TABLE capture CP=CENT/V;"
}Steady initialization supports stable affine systems and selected scalar nonlinear models with fixed coefficients. Its exact target is distinct from a numerical solver's stopping tolerance. Data-driven infusion callbacks remain outside this calendar mode.
Each simeta() or simeps() call creates a new symbolic draw at a known callback. Values already calculated in MAIN keep their original draw. No random numbers are generated during import.
{
"format": "mrgsolve",
"arithmetic": "exact_decimal",
"initial_time": "0",
"record_times": [
"0",
"1",
"2",
"4"
],
"anchors": {
"X": "mg",
"k": "1/hr",
"t": "hr",
"mrgETA1": "1",
"mrgEPS1": "mg"
},
"body": "$PROB Explicit random-effect updates at listed records\n$PARAM k=0.1\n$INIT X=100\n$OMEGA 0.04\n$SIGMA 1\n$MAIN simeta(); double ki=k*exp(ETA(1));\n$ODE dxdt_X=-ki*X;\n$TABLE simeps(); capture Y=X+EPS(1);"
}Supply every observation time. The response records each draw's covariance and callback order. This is a conditional model, not a population simulation or a claim about a numerical solver's accuracy.
Rows at the same time execute in the order you supply them. This example keeps observations before and after a dose. Conditions are evaluated once at each callback; selected draws and cached values stay fixed until their next update.
{
"format": "mrgsolve",
"arithmetic": "exact_decimal",
"initial_time": "0",
"anchors": {
"X": "mg",
"k": "1/hr",
"high": "mg",
"low": "mg",
"t": "hr",
"mrgETA1": "1",
"mrgEPS1": "mg"
},
"data": [
{
"ID": 1,
"TIME": 0,
"EVID": 0,
"CMT": 1
},
{
"ID": 1,
"TIME": 1,
"EVID": 0,
"CMT": 1
},
{
"ID": 1,
"TIME": 1,
"EVID": 1,
"AMT": 4,
"CMT": 1
},
{
"ID": 1,
"TIME": 1,
"EVID": 0,
"CMT": 1
}
],
"body": "$PROB Conditional draws and observations on both sides of a dose\n$PARAM k=0.1, high=5, low=8\n$INIT X=10\n$MAIN if (X>high) simeta(); double ki=k*exp(ETA(1));\n$ODE dxdt_X=-ki*X;\n$TABLE if (X<low) simeps(); capture Y=X+EPS(1);\n$OMEGA 0.2\n$SIGMA 1"
}The response includes each row's stored states and outputs. Conditional draws preserve their joint probability model; they do not promise the same seeded random-number stream as R.
This Michaelis–Menten example has a unique nonnegative periodic target because the average dose rate is below elimination capacity. Dissipative scalar quadratic models also support finite and overlapping steady infusions. Other autonomous coupled models, including TMDD and saturable repeated infusions, retain their initialization as an unsolved trajectory-limit problem. The response stays undetermined until its existence and convergence are established; an import does not prove a steady state, including at or above elimination capacity.
{
"format": "mrgsolve",
"arithmetic": "exact_decimal",
"initial_time": "0",
"anchors": {
"X": "mg",
"Vmax": "mg/hr",
"Km": "mg",
"t": "hr"
},
"dosing": [
{
"time": 0,
"amt": 1,
"cmt": 1,
"ii": 2,
"ss": 1
}
],
"body": "$PROB A steady bolus below saturable elimination capacity\n$PARAM Vmax=4, Km=2\n$INIT X=0\n$ODE dxdt_X=-Vmax*X/(Km+X);\n$TABLE capture Amount=X;"
}At 0, 4, 8 and 12 hours, this model checks the current concentration and tops it up to the target if needed. The condition is checked at those records; crossing the threshold between them does not trigger a dose.
{
"format": "mrgsolve",
"arithmetic": "exact_decimal",
"initial_time": "0",
"record_times": [
"0",
"4",
"8",
"12"
],
"anchors": {
"CENT": "mg",
"CL": "L/hr",
"V": "L",
"target": "mg/L",
"t": "hr"
},
"body": "$PROB Top up to a target concentration at observation times\n$PARAM CL=1, V=20, target=5\n$INIT CENT=100\n$ODE\ndxdt_CENT=-CL*CENT/V;\n$PLUGIN evtools\n$EVENT\nif (CENT/V < target) {\n evt::bolus(self, target*V-CENT, 1);\n}"
}Supply the complete observation schedule for one individual. This mode supports one immediate bolus or replacement per decision path. Within this adaptive EVENT mode, infusions, steady-state dosing, external dose records and covariate changes remain unsupported; use the separate patient or dosing contract where applicable. Branch conditions can establish when a division, logarithm or square root is valid. If that cannot be established on every execution path, the import returns an error. Importing an event does not guarantee that every property can be decided.
Send the model's source text to translate_model with its format and any required vector order and arithmetic, then review the complete imported model before verifying.
One translation path reads NONMEM, SBML, Julia ModelingToolkit and RHS, MATLAB / Octave, R deSolve, Antimony / Tellurium, mrgsolve, CellML, Content MathML, SciPy RHS and SymPy JSON. Each reader supports a defined subset and refuses unsupported constructs.
{
"format": "nonmem",
"body": "$INPUT ID TIME AMT EVID\n$SUBROUTINES ADVAN1 TRANS2\n$THETA (0,1)\n(0,10)\n$OMEGA .1\n$SIGMA .01\n$PK\nCL=THETA(1)*EXP(ETA(1))\nV=THETA(2)\nS1=V\n$ERROR\nY=F*(1+EPS(1))",
"dataset": "1 0 100 1\n1 12 0 0",
"subject_id": "1",
"nocb": true
}NONMEM imports preserve supported parameter relationships, individual effects, observation noise and patient calendars. Add the dataset and choose one subject in the request. Models use declared initial estimates unless the source selects a supported prior-based simulation. Import details state the parameter interpretation, fitting procedures and omitted records. Initial steady-state problems may be represented while convergence remains unproved. Choose nonmem_scope: "structure" only when you explicitly want the earlier ODE abstraction.
{
"format": "scipy-rhs",
"body": "from scipy.integrate import solve_ivp\ndef rhs(t, y, k):\n rate = k*y[0]\n return [-rate, rate]\ndef jac(t, y, k):\n return [[-k, 0], [k, 0]]\ndef threshold(t, y, k):\n return y[0] - 0.1\nthreshold.direction = -1\nthreshold.terminal = True\nsolution = solve_ivp(rhs, (0, 10), [1, 0], args=(1/3,), events=threshold, method=\"BDF\", jac=jac, jac_sparsity=[[1, 0], [1, 0]], rtol=1e-6, max_step=0.5)\n",
"states": [
"A",
"B"
],
"arithmetic": "exact_decimal"
}SciPy imports the RHS and exact initial-value data from one supported solve_ivp call. It preserves y0 at the actual start of t_span, scalar args and the closed time interval. Root callbacks preserve crossing direction and termination counts. Supplied Jacobian matrices and zero patterns are checked against the RHS derivatives, with exact mismatches shown. Branch boundaries are checked for matching values and state derivatives; proven kinks return left/right derivative evidence. Callback domain safety remains a separate obligation. Numerical settings are retained separately from mathematical assumptions. No solver runs: event detection, stopping times and numerical error bounds remain unverified. Some checks also remain undecided for nonzero initial times. SymPy objects can be exported with dumps_sympy_model(**context) from app.services.canonical_ir.sympy_document, then imported with format: "sympy". The JSON preserves the supported object structure; no Python source is executed.
Export an existing SciPy result and include it as numerical_solution in the translate_model request. The model supplies its original equations and initial values.
from app.services.canonical_ir.numerical_solution import from_scipy_result
claim = from_scipy_result(
solution, ["A", "B"], absolute_tolerance="1/100"
)
# Include {"numerical_solution": claim} in your import options.ANANKE bounds the maximum absolute error of the straight lines joining your samples. It uses outward interval bounds and checks the full interval between samples. This is a separate global-error claim: rtol, atol, internal dense output and event detection are not certified by this result. A bound that is too wide stays undecided; a proven error beyond your request returns a counterexample.
Ask your assistant to call guide before its first check. Your client's tools/list response is the reference for the connected server's arguments and supported input formats.
guideHow to call each tool: inputs, declarations, output layers, limits. Not counted as a call.
verify_modelVerifies the properties a model declares. Each check stands alone; there is no combined verdict.
diagnose_model_residualsResiduals and term contributions on your data, what each flow of the model is worth, and the declared rules the model breaks. Observations, not a verdict.
review_model_editReviews proposed edits against a fixed contract: three lights each, and with data the fit.
compare_model_candidatesCompares repaired equations under one fixed contract and replays earlier counterexamples.
diagnose_conservation_compatibilityCompares proved linear conservation laws with absolute state bounds from data.
translate_modelParses SBML, Antimony, CellML, NONMEM and other documents into verify_model input. Review what it read; a translation is not a verdict.
seal_certificateVerifies again on the server and stores a certificate. Needs an API key.
verify_certificateRetrieves the stored record for a certificate hash. Not counted as a call.
localize_reactionsPro plans. Suggests reactions to review; a candidate is not a proven culprit.
compare_runtime_semanticsChecks whether supplied PROTECT definitions agree on a stated input region. Checking that your model stays in that region and your runtime implements those definitions is separate.
Check that the URL ends in /mcp, select Streamable HTTP, and reconnect. Ask the client to refresh its tool list. Clients that only support local stdio cannot use a remote URL directly.
Certificate issuance needs an authenticated HTTP call. Check that your client sends X-API-Key and that the key is active. Review your keys and usage in the console.
The MCP connection uses API key headers for account access. Google sign-in on the website is separate. For authenticated tools, choose a client that can send the X-API-Key header.
The connection can be working even when a property is undecided. Read the named check, its reason, and any missing declaration in the verification guide.
Read the parser's unsupported-input or format error before verifying. An unsuccessful import is not a verified model. Check the exact format options in translate_model's schema.