schema-cleaner

Clean and normalize JSON Schemas for LLM provider compatibility.

1|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/winsorllc/upgraded-carnival --skill schema-cleaner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-cleaner
Source: https://github.com/winsorllc/upgraded-carnival/tree/main/.pi/skills/schema-cleaner
Command: npx skills add https://github.com/winsorllc/upgraded-carnival --skill schema-cleaner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill addresses the challenge of inconsistent JSON Schema support across different Large Language Model (LLM) providers, ensuring your tool-calling schemas are compatible and functional.

Core Features & Use Cases

  • Provider-Specific Cleaning: Removes keywords unsupported by specific LLM providers (e.g., Gemini, Anthropic, OpenAI).
  • Reference Resolution: Inlines $ref entries, making schemas self-contained.
  • Union Flattening: Simplifies anyOf/oneOf with literals into enum types.
  • Use Case: When defining a tool for an LLM, you can use this skill to clean its JSON schema so it works correctly whether you're targeting Gemini or OpenAI, preventing errors and ensuring reliable tool execution.

Quick Start

Use the schema-cleaner skill to clean the provided schema for the 'gemini' provider.

Frequently Asked Questions about schema-cleaner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I normalize a JSON schema for LLM tool calling across different providers?

You normalize a JSON schema for LLM tool calling by removing provider-specific unsupported keywords, resolving $ref entries, and flattening unions to ensure cross-compatible schema definitions.

Why does my JSON schema fail when using LLM tool calling with Gemini or OpenAI?

Your JSON schema may fail because different LLM providers support different schema keywords. Cleaning the schema removes unsupported provider-specific keywords to prevent execution errors.

How do I resolve $ref entries in a JSON schema to make it self-contained?

To resolve $ref entries in a JSON schema, you inline the referenced definitions directly into the schema structure, making the entire tool definition self-contained for LLM ingestion.

How do I flatten anyOf and oneOf unions with literals for API schema validation?

You flatten anyOf and oneOf unions with literals by converting them into enum types, simplifying the API schema validation process for large language models.

Can I use the same JSON schema for tool calling with both Anthropic and OpenAI?

Yes, you can use the same JSON schema for tool calling across providers by cleaning it to handle nullable types and remove unsupported keywords specific to Anthropic or OpenAI.

What is JSON schema data normalization for LLMs and when is it needed?

JSON schema data normalization for LLMs is the process of cleaning and standardizing schemas to ensure compatibility with tool-calling capabilities. It is needed when integrating LLM-powered tools across various providers.