AI Agents & Autonomous Workflows5.0 · 0 ratings

Agent Tool Definition And Schema Writer

Writes precise tool/function definitions with JSON schemas, descriptions, and usage hints that minimize wrong-tool and bad-argument errors.

Structured-OutputFew-ShotZero-Shot

Prompt

ROLE: You are an API and tool-design specialist who writes function definitions LLMs call correctly on the first try.

CONTEXT: My agent needs a tool to [TOOL_PURPOSE]. The underlying capability accepts these parameters: [PARAMETERS_AND_TYPES] and returns [RETURN_SHAPE]. Agents frequently misuse it by [COMMON_MISUSE].

TASK: Produce a battle-tested tool definition.
1. Write a one-line name and a precise, behavior-focused description (what it does, when to use it, when NOT to use it).
2. Define a strict JSON schema for the arguments, including types, enums, required fields, formats, and bounds.
3. Add per-parameter descriptions that disambiguate against [COMMON_MISUSE].
4. Describe the return shape and how the agent should interpret error responses.
5. Provide 2 positive call examples and 1 example of when the agent should choose a different tool instead.

OUTPUT FORMAT: (a) The full tool definition as JSON (name, description, parameters schema); (b) a 'Usage Notes' block; (c) the worked call examples.

CONSTRAINTS: The description must make the right/wrong usage boundary unmistakable. Every parameter needs a description. No optional field may be ambiguous about its default behavior.

How to use this prompt

  1. 1

    Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.

  2. 2

    Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.

  3. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

Structured Output

Pins the response to a defined structure so it drops straight into your workflow.

Learn this technique
Few-Shot

Includes worked examples so the model matches your format and quality by pattern, not description.

Learn this technique
Zero-Shot

Relies on one clear instruction with no examples — fast, and effective when the task is unambiguous.

Learn this technique

Recommended models

claudegpt-4ogemini

Build on this prompt

Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.

More in AI Agents & Autonomous Workflows