Skip to main content
Glama

Trigger Optimization

trigger_optimization

Start a new optimization process for an agent. Returns the optimization process ID.

IMPORTANT PREREQUISITES (optimization will fail without these):

  1. RUNS REQUIRED: The agent must have run transcripts uploaded via create_run. Optimization analyzes real user/AI dialogues to improve the agent - it cannot run without them.

  2. Business context (industry and/or objectives) must be set via sync_context_from_url or update_settings.

You can either:

  1. Use an existing agent: provide agentId

  2. Auto-create a new agent: provide prompt + agentName + llmModel

When auto-creating, the agent will be created and activated automatically before optimization starts. NOTE: Even with auto-create, you must still upload runs using create_run before triggering optimization.

Input Schema

NameRequiredDescriptionDefault
modeNoOptimization mode: 'validation' for statistical rigor, 'exploratory' for faster iteration (default: exploratory)
intentNoOptional optimization intent to guide the process
promptNoThe agent's system prompt content to optimize. Required if agentId is not provided.
agentIdNoThe ID of an existing agent to optimize. If not provided, use prompt + agentName + llmModel to auto-create.
llmModelNoLLM model for the auto-created agent (e.g., 'gpt-4o', 'claude-sonnet-5-5', 'o1'). Required if using prompt content.
agentNameNoDisplay name for the auto-created agent. Required if using prompt content instead of agentId.
customerIdNo(Converra superadmin only) Target customer ID to act on behalf of
personaIdsNoSpecific persona IDs to test against (use list_personas to find IDs)
variantCountNoNumber of variants to generate and test (default: 3, max: 5)
customVariantsNoCustom variant content to test. Each variant needs either 'content' (full prompt) or 'diff' (unified diff patch applied to baseline).
simulationTypeNoSimulation policy override. Context-grounded modes require eligible runtime context for this exact agent prompt.
agentDescriptionNoOptional description for the auto-created agent.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only flag it as a non-readonly, non-destructive, closed-world mutation. The description adds critical behavior beyond that: hard prerequisites that cause failure, the auto-creation-plus-activation side effect, and the returned process ID. These are exactly the traits an agent cannot infer from the structured fields.

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 return value, then structured into prerequisites and two modes with a labeled list. Slightly long, but every section (prerequisites, both modes, the repeated runs warning) carries actionable weight.

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?

For a 12-param, no-output-schema tool this is thorough: it covers the return value, the failure prerequisites, and the two invocation modes. It omits guidance on the more advanced parameters (variantCount, simulationType, customVariants, personaIds), though those are fully described in the schema.

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 schema already documents each parameter; baseline would be 3. The description adds genuine conditional meaning by explaining the agentId-vs-prompt branching and which fields are required for each path, which the schema alone does not express.

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 precise verb+resource ('Start a new optimization process for an agent') and the return value ('Returns the optimization process ID'). It is clearly distinguishable from siblings like validate_variant, apply_variant, stop_optimization, and list_optimizations.

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 enumerates when the tool will work and when it will fail ('optimization will fail without these'), names the required sibling tools (create_run, sync_context_from_url, update_settings), and lays out the two invocation paths (existing agentId vs auto-create with prompt+agentName+llmModel).

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.

Resources