Skip to main content
Glama
jerepaira

laya-mcp

by jerepaira

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.git

This 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-mcp

Any other MCP client: stdio command laya-mcp.

Tools

tool

what it does

decide(state, questions)

answer any set of typed questions at once

classify(text, labels, instructions?)

pick one label + confidence + scores

score(text, criteria, instructions?)

rate on an ordered scale + distribution

check(state, question)

yes/no → P(yes) in [0,1]

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

LAYA_DEVICE

auto (cuda if available, else cpu)

force "cpu" if VRAM is tight

LAYA_MODEL

auto-router per request

pin "english", "multilingual" or "typed-decisions"

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 tools
checkB

Answer a yes/no question about a state. Returns P(yes) in [0,1].

ParametersJSON Schema
NameRequiredDescriptionDefault
stateYes
questionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYes
labelsYes
instructionsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

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 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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
stateYes
questionsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYes
criteriaYes
instructionsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

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 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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 4 tool updatesv0.1.0
    • First observedcheck
    • First observedclassify
    • First observeddecide
    • First observedscore

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation2/5

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.

Naming Consistency5/5

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.

Tool Count4/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables 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.
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables 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.
    1
    136 npm
    2
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Runs 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.
    5
    MIT