simulate-monte-carlo
Real Monte Carlo simulation of a compound event/conditional probability. Paid via x402.
¿Debería usar esto?
Calidad y seguridad
Basado en el análisis automatizado de las definiciones de herramientas y el cumplimiento del protocolo.
Costo de contexto
Este es el número aproximado de tokens que se consumen cada vez que las herramientas del servidor se cargan en el contexto de un modelo. Los recuentos más altos reducen la atención disponible para otras tareas.
Instalar
Instalación con un clic
Agrega esto a tu archivo `claude_desktop_config.json`:
{
"mcpServers": {
"simulate-monte-carlo": {
"url": "https://simulate-monte-carlo.encodari.workers.dev/mcp"
}
}
}Puntos de conexión remotos
https://simulate-monte-carlo.encodari.workers.dev/mcpstreamable-httpQué puede hacer
Inventario de herramientas
Herramientas (1)
⚪simulate_monte_carlo(variables, event, condition, trials, seed)
Actually draws random samples from real distributions and counts outcomes, instead of a model guess about a probability. Declare named random variables (uniform, normal, bernoulli, binomial, poisson, exponential, discrete), an "event" boolean expression over those variable names (e.g. "a > 0.5 && b == 1"), and an optional "condition" expression to estimate a conditional probability P(event | condition) by rejection sampling. Event/condition expressions are parsed and evaluated by a small built-in interpreter (arithmetic, comparisons, &&/||/!, min/max/abs) — no arbitrary code execution. Returns the estimated probability, a 95% confidence interval, and the seed used (pass the same seed back to reproduce the exact result). Costs $0.03 USDC (Base) per call.
Esquema de entrada
{
"type": "object",
"properties": {
"variables": {
"minItems": 1,
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
"description": "Variable name, referenced by \"event\"/\"condition\" (e.g. \"a\", \"wait_time\")."
},
"distribution": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "uniform"
},
"min": {
"type": "number"
},
"max": {
"type": "number"
}
},
"required": [
"type",
"min",
"max"
],
"description": "Continuous, equally likely between min and max."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "normal"
},
"mean": {
"type": "number"
},
"stdDev": {
"type": "number",
"minimum": 0
}
},
"required": [
"type",
"mean",
"stdDev"
],
"description": "Gaussian/bell curve, via Box-Muller sampling."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "bernoulli"
},
"p": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"type",
"p"
],
"description": "Single 0/1 trial with success probability p."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "binomial"
},
"n": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000
},
"p": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"type",
"n",
"p"
],
"description": "Count of successes in n independent Bernoulli(p) trials. n capped at 1000."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "poisson"
},
"lambda": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1000
}
},
"required": [
"type",
"lambda"
],
"description": "Event count with mean rate lambda, via Knuth's algorithm. lambda capped at 1000."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "exponential"
},
"rate": {
"type": "number",
"exclusiveMinimum": 0
}
},
"required": [
"type",
"rate"
],
"description": "Time between events at the given rate."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "discrete"
},
"values": {
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"type": "number"
}
},
"weights": {
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"type": "number",
"minimum": 0
}
}
},
"required": [
"type",
"values",
"weights"
],
"description": "Weighted pick from a custom list of outcomes (e.g. a die). Up to 20 outcomes."
}
]
}
},
"required": [
"name",
"distribution"
]
},
"description": "Random variables to sample each trial. Max 10."
},
"event": {
"type": "string",
"maxLength": 500,
"description": "Boolean expression over the variable names, evaluated each trial (e.g. \"a + b > 10\", \"x == 1 && y < 0.2\")."
},
"condition": {
"description": "Optional boolean expression; if given, the result is P(event | condition), estimated only over trials where this is true.",
"type": "string",
"maxLength": 500
},
"trials": {
"description": "Number of trials to run. Default 10000, between 100 and 100000.",
"type": "integer",
"minimum": 100,
"maximum": 100000
},
"seed": {
"description": "Optional PRNG seed for a reproducible run. If omitted, a random seed is generated and returned in the output.",
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"variables",
"event"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Esquema de salida
{
"type": "object",
"properties": {
"valid": {
"type": "boolean",
"description": "false if the input (variables, expressions, limits) was invalid."
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Error or warning message. null if none."
},
"trials_run": {
"type": "number",
"description": "Number of trials actually simulated (0 if valid is false)."
},
"seed_used": {
"type": "number",
"description": "The PRNG seed used — pass it back as `seed` to reproduce this exact result."
},
"probability": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Estimated P(event) or P(event | condition). null if invalid, or if condition matched zero trials."
},
"event_successes": {
"type": "number",
"description": "Number of trials (or condition-matching trials) where event was true."
},
"condition_successes": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Number of trials where condition was true. null if no condition was given."
},
"standard_error": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Estimated standard error of the probability estimate."
},
"confidence_interval_95": {
"anyOf": [
{
"type": "array",
"prefixItems": [
{
"type": "number"
},
{
"type": "number"
}
]
},
{
"type": "null"
}
],
"description": "Approximate 95% confidence interval [low, high] via the normal approximation."
}
},
"required": [
"valid",
"error",
"trials_run",
"seed_used",
"probability",
"event_successes",
"condition_successes",
"standard_error",
"confidence_interval_95"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}Comunidad
Evidencia