Skip to main content
Glama

start_optimization_session

Run a single optimization cycle on a workspace: evaluate the system prompt against test cases, score responses, analyze failures, and generate a revised prompt suggestion for user review.

Instructions

Run one optimization pass on an existing workspace.

Prerequisites (do these first):

  1. start_web_app → workspace URL + ID

  2. set_system_prompt → starting prompt

  3. add_test_cases → at least one case with targetAnswer

What this does:

  1. Read system prompt and test cases from get_workspace_state.

  2. Run each test case against the model (write + execute a temp Node.js script).

  3. Score each response vs targetAnswer (LLM-as-judge, 0–100), call post_test_result.

  4. Analyse failures, write improved prompt, call post_prompt_suggestion.

  5. Present the suggestion — do NOT auto-apply. User reviews in the UI.

This is one iteration. After the user approves or rejects the suggestion, call start_optimization_session again or switch to loop_optimization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYes
thresholdNoPass score 0–100 (default 70)
maxIterationsNoGoal iterations for tracking (default 5)
Behavior4/5

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

With no annotations, the description details the entire internal process: reading state, running tests, scoring, analysing failures, writing prompts. It does not mention error handling or side effects on failure, but covers the main behavioral flow.

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 structured with prerequisites and numbered steps, front-loading the purpose. It is thorough but not excessively long; every sentence contributes value.

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?

Given the complexity and no output schema, the description fully explains prerequisites, internal steps, and follow-up actions. It references sibling tools and integrates the workflow context.

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?

Two of three parameters have schema descriptions (67% coverage). The description adds default values for threshold (70) and maxIterations (5), enhancing understanding beyond the schema.

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 verb 'Run one optimization pass' on 'an existing workspace'. It distinguishes from sibling tool 'loop_optimization' by noting this is one iteration.

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 lists three prerequisites (do these first) and provides a clear after-action: user reviews, then call again or switch to loop_optimization. Also warns 'do NOT auto-apply'.

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/jurek-f/prompt-lab-mcp'

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