laya-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@laya-mcpClassify this support message as billing or technical."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
laya-mcp
Laya as an MCP server: typed
decisions (choice / score / noul) with real probabilities in ~20-40 ms,
on your own machine. No LLM calls, no tokens, no API keys, 100+ languages.
Same tool interface as jev-local, so it is a drop-in replacement wherever
those tools are used.
Install
pip install git+https://github.com/jerepaira/laya-mcp.gitThis pulls laya (which pulls torch) — for NVIDIA GPU you get CUDA
support out of the box; on CPU-only machines it just runs slower
(~15 s for the first call, milliseconds after warmup).
Model weights (~2 GB) download automatically from HuggingFace on first use.
Related MCP server: Jevbridge
Use with your agent
opencode (~/.config/opencode/opencode.json):
"mcp": {
"laya": {
"type": "local",
"command": ["laya-mcp"],
"enabled": true
}
}Claude Code (claude mcp add):
claude mcp add laya -- laya-mcpAny other MCP client: stdio command laya-mcp.
Tools
tool | what it does |
| answer any set of typed questions at once |
| pick one label + confidence + scores |
| rate on an ordered scale + distribution |
| yes/no → |
Example — route a support message:
classify("me cobraron dos veces, quiero la devolución",
["billing", "technical", "sales", "other"])
→ {"label": "billing", "confidence": 0.845, "scores": {...}}Config
env | default | meaning |
| auto ( | force |
| auto-router per request | pin |
Tip: Spanish text routes to the multilingual checkpoint. Pinning one model
with LAYA_MODEL avoids checkpoint reloads when requests mix languages.
Accuracy notes
Out of the box it is fast and decent, not magic — wording of the question matters a lot and thresholds should be calibrated on your own labeled examples before trusting the probabilities. Measure, don't assume.
Credits
Decision model by Nandakishor M (Convai Innovations), Apache-2.0. This repo is only the MCP wrapper (MIT).
Available Tools
4 toolscheckB
Answer a yes/no question about a state. Returns P(yes) in [0,1].
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | ||
| question | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses the output format (P(yes) in [0,1]) and the binary nature of the question, which is useful. However, it does not disclose whether the tool is deterministic, whether it requires a specific state format, or any side effects (though likely none).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is front-loaded with the core purpose and includes the key output detail. Every word earns its place; no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with only two string parameters and an output schema, so the description is mostly adequate. However, with no annotations and no parameter semantics, an agent may not know how to construct a valid 'state' or 'question' string, or how the output schema maps to the probability. Slightly more context would be needed for full confidence.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not explain what 'state' or 'question' mean beyond their names. The description adds the context that the question is yes/no and the output is a probability, but it does not clarify the expected format or semantics of the two parameters, leaving the agent to infer.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('answer') and resource ('a yes/no question about a state'), and clarifies the output is P(yes) in [0,1]. It is clear about what the tool does, though it does not explicitly differentiate from siblings like decide or classify.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for yes/no questions about a state, but provides no explicit guidance on when to use this tool versus siblings (decide, classify, score). The context is clear enough for a simple binary question, but no exclusions or alternatives are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
classifyA
Pick the single best label for a text, with calibrated confidence and a score for every label. Use for routing, tagging, moderation, triage.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| labels | Yes | ||
| instructions | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses that the tool returns calibrated confidence and a score for every label, which is useful behavioral information. However, it does not disclose whether the tool mutates any state, whether it requires authentication, or what happens with ties or invalid labels. The description adds some behavioral context but not comprehensive transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no filler. The core action and output are front-loaded, and the use cases are listed compactly. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema, so return values are already documented. The description covers the tool's purpose, output characteristics (calibrated confidence, per-label scores), and typical use cases. It lacks explicit guidance on the 'instructions' parameter and edge cases, but for a classification tool with an output schema, this is reasonably complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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. It explains the purpose of 'text' and 'labels' implicitly ('Pick the single best label for a text') and mentions 'instructions' indirectly through 'calibrated confidence' but does not explain the format or role of the 'instructions' parameter. The description adds meaning beyond the schema for the two required parameters but leaves the optional 'instructions' parameter under-specified.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Pick'), a specific resource ('the single best label for a text'), and a clear outcome ('with calibrated confidence and a score for every label'). It also names the intended use cases (routing, tagging, moderation, triage), which distinguishes it from generic classification tools and from siblings like 'decide' or 'score'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly lists use cases (routing, tagging, moderation, triage) and implies that this tool is for single-best-label selection, which differentiates it from 'score' (likely multi-label scoring) and 'decide' (likely binary or decision-oriented). It does not explicitly state when NOT to use it or name alternatives, but the use-case list and 'single best label' phrasing provide clear context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
decideB
Make typed decisions about a state. questions maps an id to {type: "choice"|"score"|"noul", instructions, criteria}. For choice, criteria is {key: description}; for score, a list of level labels. Returns each answer with a probability distribution.
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | ||
| questions | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, and it does disclose that each answer is returned with a probability distribution and defines the question type variants. However, it does not clarify whether decisions are deterministic or sampled, what side effects exist, or what the 'noul' type means.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded, packing useful detail into two sentences without obvious filler. The notation is dense but readable, though the unexplained 'noul' costs it a perfect score.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has nested objects, a type union, and no annotations, so the description must do substantial work. It covers the main question structure and output shape, but leaves the 'noul' variant, the meaning of 'instructions', and the expected format of 'state' underspecified. An output schema exists, so omitting return details is acceptable, but invocation still has gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description compensates well for 'questions' by explaining the id-to-object mapping, type union, and criteria shapes for choice and score. The 'state' parameter remains vaguely described as the thing being decided about, so the compensation is uneven.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence names the operation ('make typed decisions') and resource ('a state'), and the type union choice/score/noul gives concrete scope. It does not explicitly differentiate from siblings classify/score/check, but the description is clear enough to understand what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no guidance on when to use this tool versus classify, score, or check. It does not state prerequisites, exclusions, or the context in which decide is the right choice. Usage must be inferred entirely from the meaning of 'decide'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
scoreB
Rate a text on an ordered scale given by criteria (low to high). Returns the probability-weighted score plus the distribution.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| criteria | Yes | ||
| instructions | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the disclosure burden. It does add useful behavioral context by stating that the result is a 'probability-weighted score plus the distribution.' However, it does not address side effects, failure modes, or requirements such as how criteria should be ordered or validated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences with no filler. The action and target are front-loaded, and the output behavior is stated immediately afterward. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a relatively simple tool with an output schema present, the description covers the core inputs and return shape adequately. Still, it lacks usage alternatives and leaves the optional instructions parameter undefined, making it sufficient but not fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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. It clarifies that 'criteria' form a low-to-high ordered scale and that 'text' is the target being rated, which adds meaning beyond the raw schema. However, the optional 'instructions' parameter is left completely unexplained.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Rate'), identifies the resource ('a text'), and clearly defines the scale as 'ordered scale given by criteria (low to high)'. This reasonably differentiates it from siblings like decide, classify, and check, though it does not explicitly name them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for rating a text on an ordered scale, but it provides no explicit when-to-use guidance and does not contrast it with the sibling tools decide, classify, or check. An agent must infer when this tool is preferred over alternatives.
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.
4 tool updates
v0.1.0- First observed
check - First observed
classify - First observed
decide - First observed
score
TDQS
Scored across 4 tools
decide is a generic decision engine that can handle choice and score types, which substantially overlaps with classify and score. The specialized tools add context (text vs. state), but the boundaries are not crisp, and an agent could easily misselect decide for tasks the others are designed for.
All four tool names are single lowercase verbs with no mixed conventions or inconsistent patterns. The imperative style is consistent and easy to predict, even if the verbs are somewhat generic.
Four tools is a reasonable number for a decision/classification/rating server. However, decide's broad scope makes classify, score, and check feel somewhat redundant, so the count earns slightly less than full marks.
The set covers common decision tasks: choice/classification, ordered scoring, and yes/no checking, plus the generic noul type through decide. Minor gaps exist around batch processing or clearer support for unstructured outputs, but the core decision surface appears well covered.
Maintenance
Related MCP Connectors
Deterministic contextual decision arbitration and action routing for autonomous software. Takes current state, context, or intent plus caller-supplied candidate actions, state transitions, routes, refusals, escalations, tools, or models and returns a deterministic ordered candidate field. Also provides persistent machine representations for memory, retrieval, indexing, and downstream coherence measurement.
Deterministic decision layer for autonomous agents: reproducible PROCEED/REVIEW/SKIP verdicts.
Deterministic prompt-injection detector; signed, offline-verifiable verdicts. Not an LLM.
Deterministic AI agent microtools, no accounts/API keys. fetch_extract: 98% token cut. 38 tools.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables agents to get fast, calibrated probabilistic answers from Jev (Typesafe AI) to yes/no, scale, or choice questions about provided material, without using a generative model.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables typed decisions, confidence-gated tool calls, and computer-use action selection for any LLM via Model Context Protocol, bridging TypeSafe Jev with Codex, Claude, Grok, and OpenCode.30MIT
- AlicenseAqualityBmaintenanceEnables AI coding agents to make fast, zero-output-token decisions by evaluating context, diffs, logs, or options through the OpenRouter Decisions API using TypeSafe Jev, returning calibrated probabilities for binary, categorical, or scoring questions.1136 npm2MIT
- AlicenseAqualityBmaintenanceRuns TypeSafe Jev System One packs locally, enabling agents to perform typed Choice, Noul, and Score judgments for tasks like PR auditing, intent routing, and locale classification.5MIT