Skip to main content
Glama

Validate Python Model

python.validate
Read-onlyIdempotent

Statically check a python_model script (BYO model class) without running it.

Compiles the source and verifies the contract — a class with fit(X, y, info) and predict(X); optional predict_proba(X) unlocks confidence panels. Never executes the code, so it is safe against the hosted backend. Use it before execution.run to catch syntax errors, missing methods, or the wrong class name cheaply.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "python.validate"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesPython source of the model class (<=256KB UTF-8).
class_nameNoContract class to instantiate; omit to auto-detect the first class defining fit+predict.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / code / description
      Previous value: -"Python source of the model class (<=256KB)."New value: +"Python source of the model class (<=256KB UTF-8)."
  2. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the description's 'Never executes the code, so it is safe against the hosted backend' is reinforcement rather than new information. It does add genuine behavioral value by spelling out the contract being verified — fit(X, y, info), predict(X), optional predict_proba(X) unlocking confidence panels — which the annotations cannot convey.

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?

Front-loaded with the core action and purpose, then the contract detail, then the usage guidance — good ordering. Minor redundancy between 'without running it' and 'Never executes the code', and the mid-sentence line breaks hurt readability slightly.

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?

An output schema exists, so return values need not be explained, and the description covers purpose, contract, safety, and sequencing adequately for a two-parameter validation tool. It does not state what a failing validation produces, but the output schema carries that burden.

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 100%, so both 'code' (size limit) and 'class_name' (auto-detect behavior) are already documented in the schema. The description only indirectly touches parameters by naming 'the wrong class name' as a failure mode, adding little beyond the structured fields.

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?

States a specific verb and resource: 'Statically check a python_model script (BYO model class) without running it.' The parenthetical clarifies the resource type, and the mention of 'execution.run' as the downstream step distinguishes it from sibling validation tools such as pipeline.validate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Explicitly says 'Use it before execution.run' and lists the concrete failure classes it catches cheaply (syntax errors, missing methods, wrong class name). The agent gets both the trigger condition and the alternative it defers to.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.