Migrate Tool-Calling Schemas Across OpenAI, Claude, and Gemini

Convert your existing function definitions into native OpenAI, Anthropic Claude, and Google Gemini tool specs with a schema compatibility matrix.

Text prompt for Claude and Gemini

You get: Compatibility Matrix, openAI Tool Spec and anthropic Claude Tool Spec

Prompt

Prompt
Act as a staff AI platform engineer who maintains multi-provider LLM gateways.

I will paste one or more existing tool-calling or function-calling definitions below this prompt, along with my current provider. Your job is to translate them into native tool specifications for OpenAI, Anthropic Claude, and Google Gemini while preserving parameter semantics and flagging schema incompatibilities.

Follow these rules:
1. Map every top-level wrapper field accurately, including OpenAI strict mode requirements, Claude input_schema formatting, and Gemini functionDeclarations types.
2. Flag every unsupported or risky JSON Schema keyword such as oneOf, anyOf, allOf, patternProperties, default, or additionalProperties in a compatibility matrix.
3. For OpenAI strict mode, ensure every object sets additionalProperties to false and lists all properties in required, converting optional fields to nullable types where needed.
4. Keep parameter names, descriptions, and enum values identical across providers unless a provider constraint forces a change, and document any forced change explicitly.
5. Output the translated tool definitions in clean YAML so they are easy to diff and convert to JSON or SDK objects.

Output format:
1. Compatibility Matrix (Markdown table with columns: Keyword or Feature, OpenAI, Claude, Gemini, Required Workaround)
2. OpenAI Tool Spec (YAML)
3. Anthropic Claude Tool Spec (YAML)
4. Google Gemini Tool Spec (YAML)
5. Migration Risks and Verification Checklist (3-5 concrete checks to run in unit tests)

End with one line listing any assumptions made about SDK versions, strict-mode settings, or missing parameter constraints.

Example output

Schema keyword support: OpenAI vs Claude vs GeminiCompatibility matrix for the refund tool migration
ItemClaudeGemini
Top-level wrapperinput_schemafunctionDeclarations
additionalProperties: falseSupportedIgnored or rejected
Optional propertiesSupportedSupported
oneOf / anyOfSupportedLimited support

Example for: migrating an OpenAI refund-processing tool with optional reason codes and nested metadata to Claude and Gemini.

1. Compatibility Matrix
Keyword or FeatureOpenAIClaudeGeminiRequired Workaround
Top-level wrappertype: function, strict: trueinput_schemafunctionDeclarationsMap wrapper keys per provider SDK
additionalProperties: falseRequired in strict modeSupportedIgnored or rejectedStrip from Gemini schema; keep for OpenAI and Claude
Optional propertiesMust be in required as nullableSupportedSupportedUse type array with null in OpenAI; omit from required in Claude and Gemini
oneOf / anyOfLimited in strict modeSupportedLimited supportFlatten into a single object with a discriminator enum
2. OpenAI Tool Spec
type: function
function:
  name: issue_customer_refund
  description: Create a full or partial refund for a settled invoice.
  strict: true
  parameters:
    type: object
    additionalProperties: false
    required:
      - invoice_id
      - amount_cents
      - reason_code
      - note
    properties:
      invoice_id:
        type: string
        description: Unique invoice identifier such as inv_84920.
      amount_cents:
        type: integer
        description: Refund amount in USD cents.
      reason_code:
        type: string
        enum:
          - duplicate_charge
          - damaged_item
          - customer_request
      note:
        type:
          - string
          - "null"
        description: Optional internal audit note.
3. Anthropic Claude Tool Spec
name: issue_customer_refund
description: Create a full or partial refund for a settled invoice.
input_schema:
  type: object
  additionalProperties: false
  required:
    - invoice_id
    - amount_cents
    - reason_code
  properties:
    invoice_id:
      type: string
      description: Unique invoice identifier such as inv_84920.
    amount_cents:
      type: integer
      description: Refund amount in USD cents.
    reason_code:
      type: string
      enum:
        - duplicate_charge
        - damaged_item
        - customer_request
    note:
      type: string
      description: Optional internal audit note.
4. Google Gemini Tool Spec
functionDeclarations:
  - name: issue_customer_refund
    description: Create a full or partial refund for a settled invoice.
    parameters:
      type: OBJECT
      required:
        - invoice_id
        - amount_cents
        - reason_code
      properties:
        invoice_id:
          type: STRING
          description: Unique invoice identifier such as inv_84920.
        amount_cents:
          type: INTEGER
          description: Refund amount in USD cents.
        reason_code:
          type: STRING
          enum:
            - duplicate_charge
            - damaged_item
            - customer_request
        note:
          type: STRING
          description: Optional internal audit note.
5. Migration Risks and Verification Checklist
  • Validate that Gemini uppercase type names (OBJECT, STRING, INTEGER) match your SDK version before deploying.
  • Add a unit test ensuring your backend treats an explicit null note from OpenAI the same as an omitted note from Claude or Gemini.
  • Confirm your OpenAI gateway enforces strict: true so the model cannot hallucinate extra keys.

Assumptions: Assumes OpenAI Chat Completions or Responses API with strict mode enabled, Anthropic Messages API, and Google GenAI SDK with uppercase Schema types.

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

Tips and common edits

Why this works

  • Forces an explicit compatibility matrix for tricky JSON Schema keywords like oneOf and additionalProperties before generating code.
  • Enforces OpenAI strict-mode rules automatically by converting optional fields to nullable required fields.
  • Adds a concrete unit-test verification checklist so subtle null-versus-omitted mismatches do not break production handlers.

Use this when porting agent tools across OpenAI, Claude, or Gemini in ChatGPT, Claude, or Gemini. Paste your current tool definition in JSON, YAML, or TypeScript right after the prompt, and note whether you need OpenAI strict mode.

Common edits

  • Ask for Pydantic or Zod source definitions instead of YAML if you generate provider schemas from a single typed model.
  • Remove one provider section if you are only migrating from OpenAI to Claude or from Claude to Gemini.

Reuse it: Use in a workflowTurn into a skillAdapt in the builder

Major AI ModelsCodex

Structured JSON Output Conformance Tester with Retry and Repair Across Providers

Prompt Codex to build a test script that checks whether each model returns schema-valid JSON for your inputs, using each provider's native structured output feature, with measured retry and repair rates.

Major AI ModelsCodex

Provider-Agnostic LLM Client Adapter for OpenAI, Claude, and Gemini

Have Codex build a thin, config-driven client that normalizes requests, responses, errors, and token usage across several model providers, so switching models becomes a config change instead of a rewrite.

Major AI ModelsClaude

Restructure Production Prompts for Cross-Provider Prompt Caching

Get a refactored prompt layout separating static prefixes from dynamic inputs, plus a token cache-hit savings table for OpenAI, Anthropic, and Gemini.

Major AI Models

Audit AI Prompts for Universal Compatibility and Portability

Identify vendor-specific jargon and rewrite your prompts into universal instructions that work consistently across ChatGPT, Claude, and Gemini.

Major AI Models

Create Automated Regression Test Suites for AI Prompt Migrations

Generate a rigorous test suite to validate prompt stability across model versions by focusing on negative edge cases and output schema adherence.

Major AI Models

Migrate OpenAI System Prompts to Claude XML Format

Convert your existing OpenAI instructions into optimized XML-tagged blocks for Claude that improve instruction adherence and context parsing.