Skip to main content
Glama

Python.Validate

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.

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.7/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 safety profile is partly covered. The description still adds genuine behavioral context: it never executes code, is safe against the hosted backend, verifies the fit/predict contract, and notes that optional predict_proba unlocks confidence panels. Missing details like size limits are handled in the schema, so this is strong but not exhaustive.

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?

Front-loads the core action in the first sentence, then layers contract and usage guidance. No filler; every clause (contract methods, non-execution, the execution.run handoff) earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description need not describe return values, and it covers everything else an agent needs: what is validated, what makes a class valid, and when to invoke it relative to execution.run.

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 100%, so the baseline is 3. The description goes beyond it by spelling out the contract a valid class must satisfy (fit(X, y, info), predict(X), optional predict_proba), which clarifies what class_name auto-detection and validation actually mean.

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 (statically check) and resource (python_model script / BYO model class) and immediately distinguishes itself from siblings by emphasizing it does not run the code. An agent can differentiate it from pipeline.validate or execution.run without opening any schema.

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 names the alternative (execution.run) and the condition for choosing this tool: 'Use it before execution.run to catch syntax errors, missing methods, or the wrong class name cheaply.' This is exactly the when-and-why guidance the dimension asks for.

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.