Skip to main content
Glama

test_ai_action

Test AI prompts in isolation to evaluate responses before integrating into workflows. Submit prompt templates with variables and expected output structures for validation.

Instructions

Test an AI prompt in isolation without creating a workflow or execution. Pass a prompt template with {{variable}} syntax and variable values to run the AI and see the response. Useful for tuning prompts and response structures before adding an AI step to a workflow. Example: test_ai_action("Analyze this company: {{company}}", { company: "Stripe" }, { score: "number 0-100", summary: "string" })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
templateYesPrompt template with {{variable}} placeholders
variablesNoVariable values to substitute in the template
responseStructureNoExpected JSON output shape (e.g., { score: "number 0-100", summary: "string" })
responseTypeNoResponse format: "json" (default) or "text"
systemPromptNoOptional system instructions for the AI

Implementation Reference

  • The MCP tool 'test_ai_action' is registered here. It takes a template, variables, and response structure as input and delegates the execution to the 'testAiAction' method of the 'client' object.
        server.tool(
            'test_ai_action',
            `Test an AI prompt in isolation without creating a workflow or execution.
    Pass a prompt template with {{variable}} syntax and variable values to run the AI and see the response.
    Useful for tuning prompts and response structures before adding an AI step to a workflow.
    Example: test_ai_action("Analyze this company: {{company}}", { company: "Stripe" }, { score: "number 0-100", summary: "string" })`,
            {
                template: z.string().describe('Prompt template with {{variable}} placeholders'),
                variables: z.record(z.string(), z.any()).optional().describe('Variable values to substitute in the template'),
                responseStructure: z.record(z.string(), z.any()).optional().describe('Expected JSON output shape (e.g., { score: "number 0-100", summary: "string" })'),
                responseType: z.enum(['json', 'text']).optional().describe('Response format: "json" (default) or "text"'),
                systemPrompt: z.string().optional().describe('Optional system instructions for the AI'),
            },
            async ({ template, variables, responseStructure, responseType, systemPrompt }, extra) => {
                const client = clientFactory(extra);
                const result = await client.testAiAction(template, variables, responseStructure, {
                    responseType,
                    systemPrompt,
                });
                return {
                    content: [{
                        type: 'text' as const,
                        text: JSON.stringify(result, null, 2),
                    }],
                };
            }
        );
  • The 'testAiAction' method on the AgentledClient class performs the actual API call to the '/step/test-ai' endpoint.
    async testAiAction(
        template: string,
        variables?: Record<string, any>,
        responseStructure?: Record<string, any>,
        options?: { responseType?: string; systemPrompt?: string }
    ) {
        return this.request('/step/test-ai', {
            method: 'POST',
            body: JSON.stringify({
                template,
                variables,
                responseStructure,
                responseType: options?.responseType,
                systemPrompt: options?.systemPrompt,
            }),
        });
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does well: it explains this is a testing operation that doesn't create workflows or executions (clarifying it's non-destructive), mentions it's for prompt tuning, and provides an example showing how it works. It doesn't mention rate limits or authentication needs, but covers core behavioral aspects adequately.

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?

Perfectly structured: first sentence states purpose, second explains parameter usage, third provides usage context, and fourth gives a concrete example. Every sentence earns its place with zero waste, and key information is front-loaded.

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 tool with 5 parameters, 100% schema coverage, but no output schema, the description does well: it explains the tool's purpose, usage context, and provides an example. It doesn't describe return values (no output schema), but given the example shows expected response structure, it's reasonably complete. Could benefit from mentioning error cases or limitations.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds some value through the example showing how parameters work together, but doesn't provide additional semantic context beyond what's already in the schema descriptions. The example illustrates parameter usage but doesn't explain semantics beyond 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 specific action: 'Test an AI prompt in isolation without creating a workflow or execution.' It distinguishes from siblings like 'test_app_action' by focusing on AI prompt testing rather than app action testing, and from workflow-related tools by emphasizing isolation from workflow creation.

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: 'Useful for tuning prompts and response structures before adding an AI step to a workflow.' It also implies when not to use (when you want to create workflows or executions) by contrasting with sibling tools like 'create_workflow' and 'start_workflow'.

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/Agentled/mcp-server'

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