Skip to main content
Glama
optuna

Optuna MCP Server

Official
by optuna

best_trial

Retrieve the best trial from a completed single-objective optimization study.

Instructions

Get the best trial

    This feature can only be used for single-objective optimization. If your study is multi-objective, use best_trials instead.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
trial_numberYes
paramsNoThe parameter values suggested by the trial.
valuesNoThe objective values of the trial.
user_attrsNoUser-defined attributes for the trial.
system_attrsNoSystem-defined attributes for the trial.
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses the key behavioral restriction (single-objective only) and implies read-only via 'Get'. However, it does not describe what happens if called incorrectly (e.g., error behavior) or provide details about the return value beyond what the output schema conveys. The restriction is valuable transparency, but lacks fuller behavioral context.

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 sentences, front-loaded with the core purpose, and a clear usage condition. Every word earns its place. No redundancy or filler.

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?

For a simple parameterless getter with an output schema, the description is fully complete: it states the purpose, the single-objective constraint, and directs to the correct sibling for multi-objective. No 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?

The tool has zero parameters, so schema coverage is 100% and description needs to add no parameter info. According to the rubric, 0 parameters gives a baseline of 4. No additional param explanation is needed.

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 clearly states the tool's purpose: 'Get the best trial'. It immediately distinguishes from siblings by specifying that it is only for single-objective optimization, and directs to best_trials for multi-objective. The verb+resource is specific.

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 states when to use this tool: 'only be used for single-objective optimization'. It also provides a clear alternative: 'if your study is multi-objective, use best_trials instead'. This gives clear usage context and exclusion.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/optuna/optuna-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server