Skip to main content
Glama

run_few_shot_optimization

Applies few shot prompt optimization to a prompt using user provided dataset and method.

    Args:
        prompt_to_optimize: The zero-based index of the prompt to improve.
        example_path: GCS path to the csv file containg few-shot examples
        method: The optimization method to use for few shot prompt improvement. The
            method should be one of the following:
            - TARGET_RESPONSE: Optimize the prompt to match the target response.
            - RUBRICS: Optimize the prompt to improve the rubrics scores.

    Returns:
        Optimized prompt.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodYes
example_pathYes
prompt_to_optimizeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

TDQS

A3.5/5.0
Behavior2/5

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

Since no annotations are provided, the description carries full responsibility for behavioral disclosure. It states it returns an optimized prompt but does not disclose side effects like whether the original prompt is modified, what happens with the result, or any authentication or rate-limiting requirements.

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?

The description is concise and well-structured, with a clear docstring format including Args and Returns sections. It uses bullet-like formatting for method options, making it easy to scan. Every sentence adds value.

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

Completeness3/5

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

The description explains inputs and output but lacks context on how the optimized prompt is stored or used (e.g., does it update an existing prompt? is it temporary?). No error conditions or result format beyond 'Optimized prompt' are mentioned. Given the tool's complexity and no annotations, more completeness is expected.

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 input schema has 0% description coverage, but the tool description adds meaningful details: prompt_to_optimize is a zero-based index, example_path is a GCS path to a CSV file, and method lists allowed values (TARGET_RESPONSE, RUBRICS) which are not in the schema. This significantly aids parameter understanding.

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 applies few-shot prompt optimization using a user-provided dataset and method, specifically identifying the verb 'applies' and resource 'few shot prompt optimization'. It distinguishes from sibling tools like run_data_driven_optimize by focusing on few-shot optimization.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus its siblings. It does not mention when to choose few-shot over data-driven optimization, nor does it specify prerequisites or when not to use it.

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.

TDQS

B3.1/5.0
Disambiguation4/5

Tools are generally distinct, with prompt CRUD operations clearly separated from optimization workflows. However, 'analyze_data_driven_optimize_results' and 'generate_html_report' could be confused as both relate to results analysis, and 'call_dashscope_mcp' is an outlier with a different purpose.

Naming Consistency5/5

All tools follow a consistent snake_case verb_noun pattern (e.g., create_prompt, run_data_driven_optimize, write_data_driven_optimize_config). The naming is predictable and clear, with no mixed conventions.

Tool Count5/5

11 tools is appropriate for a Vertex AI prompt optimization and management server. It covers prompt CRUD, optimization jobs, config generation, analysis, and reporting without being excessive or insufficient.

Completeness4/5

The tool surface covers prompt lifecycle (CRUD) and key optimization workflows (data-driven, few-shot, config, analysis, report). Minor gaps exist, such as no dedicated tool to fetch optimization job status separately (though wait_for_completion is an option), and 'call_dashscope_mcp' feels extraneous.

Resources