Design Mock Tool Fixtures for Agent Trajectory Testing

Generate deterministic mock tool responses to test agent decision trees, edge-case failures, and schema-breaking payloads without live API usage or costs.

Agent prompt for Claude and ChatGPT

Prompt

Prompt
Act as a software engineer specializing in AI agent reliability. Your goal is to design a set of synthetic mock tool fixtures to unit-test an agent trajectory decision tree. Please ask me these 3 questions first: 1. What is the name and purpose of the tool function? 2. What are the 3 most critical success scenarios and 2 failure modes to test? 3. Does the tool use JSON or XML for output? After I answer, provide the test suite. Rules: Every fixture must include a specific status code and a descriptive reason for the response. Include one payload that violates the expected schema to test error handling. Use a clear, tabular format for the test cases. Assume no responsibility for production system uptime; this is for testing logic.

Example output

Example for: a weather_lookup tool used by a travel planning agent.| Scenario | Status Code | Response Payload | Expected Agent Logic |
| :--- | :--- | :--- | :--- |
| Successful Query | 200 | {temperature: 22, condition: sunny} | Proceed to itinerary generation |
| Invalid Location | 404 | {error: location_not_found} | Ask user to re-enter city name |
| Network Timeout | 503 | {error: service_unavailable} | Retry once after 2 seconds |
| Schema Violation | 200 | {temp: 22} | Log parsing error and skip tool |
| Rate Limited | 429 | {error: quota_exceeded} | Flag tool as unavailable for session |

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Forces clear definition of success and failure states.
  • Includes schema-breaking tests to verify robustness.
  • Uses a tabular format for easy integration into test suites.

Use this prompt to build robust unit tests for your agent's tool-calling logic. It works best in Claude, ChatGPT, or Gemini. Paste the result into your local test suite or mock server configuration to verify recovery paths.

Common edits

  • Add more complex nested data structures to the payloads.
  • Adjust the status codes to match your specific API standards.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Agent OrchestrationClaude

Triage Dead-Letter Queue Logs for Failed AI Agents

Sort unhandled agent run failures into an actionable classification table separating tool downtime, invalid schema calls, and missing user context.

Agent Orchestration

Create Error Handling Contracts for AI Agents

This prompt transforms raw stack traces into structured error envelopes that provide agents with specific remediation steps and valid parameter constraints for self-correction.

Agent OrchestrationClaude Code

Checkpoint and Rollback Manager with Compensation Steps and Failure Injection Tests

Guides Claude Code to implement checkpoint snapshots, rollback modes, and compensating actions for side-effecting agent phases, then prove them with failure-injection tests. Helps you decide the rollback strategy per phase.

Agent OrchestrationClaude Code

Typed Phase Handoff Contracts and Validator for Multi-Agent Pipelines

Has Claude Code define schema-based handoff contracts between agent phases, generate a validator, and add contract tests. Supports the decision of which phase boundaries need strict contracts versus lightweight checks.

Agent OrchestrationClaude

Create Role-Based Tool Gating Matrix for AI Agents

Generate a security-focused tool access matrix that restricts AI agent capabilities based on user permissions and execution phases.

Agent OrchestrationClaude

Define Context Compression Rules for Long-Running AI Agents

Create a formal policy for compressing conversation history and managing agent memory to ensure long-running threads remain efficient without losing critical task data.