Skip to main content
Glama

run_few_shot_optimization

Improves prompts by optimizing few-shot examples from a user-provided dataset, applying a specified method to match target responses or improve rubric scores.

Instructions

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
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It describes that the tool 'applies' optimization and 'returns optimized prompt', but it does not state whether the original prompt is modified, what permissions are required, or any side effects. This lack of detail is insufficient for safe invocation.

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 concise, fitting in a short paragraph with clear parameter details. However, the 'Args:' section is redundant given the schema, but it serves as the only documentation due to 0% schema coverage. It is efficient but could be slightly more structured.

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?

Given that an output schema exists (though not detailed here), and the parameters are simple, the description covers the essential inputs and output. However, it lacks behavioral context like side effects, permissions, or expected behavior when optimization fails. For a tool with no annotations, this is a notable gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Since schema description coverage is 0%, the description provides all parameter meaning. It explains that prompt_to_optimize is a zero-based index, example_path is a GCS path to CSV, and method is an enum with two options (TARGET_RESPONSE, RUBRICS) and their purposes. This adds critical value beyond the schema, which only has titles.

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 action: 'Applies few shot prompt optimization to a prompt using user provided dataset and method.' It specifies the verb 'applies', the resource 'few shot prompt optimization', and the inputs. This distinguishes it from sibling tools like run_data_driven_optimize by explicitly naming 'few shot'.

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 explicit guidance on when to use this tool versus alternatives such as run_data_driven_optimize or other siblings. It mentions method options (TARGET_RESPONSE, RUBRICS) but does not explain when each method is appropriate. The agent is left to infer usage context from the tool name and parameters.

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/hzy9981/vertex-ai-mcp-bridge'

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