Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Tool Schema Minifier

schema.minify_tool_schema

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

A tool schema is re-sent on every agent turn, so every annotation in it is paid for again and again. We remove the parts that cannot change whether a document validates — titles, descriptions, comments, examples, definitions nothing references, keywords set to the value the specification already assumes, and a type a sibling const or single-member enum already forces — and we publish the keep list too, so you can see that type, required, bounds, patterns, formats, default, deprecated, readOnly and writeOnly all survive. Each removal comes back with its pointer and reason, and the saving is reported in tokens from a named tokenizer with its pinned engine version, measured over the same whitespace-free serialisation on both sides.

A tool schema is not paid for once at design time; it is paid for on every agent turn, in the context window, for as long as the tool exists. Half of a typical one is prose a validator never reads.

Reliability

The same schema and options always produce the same output, byte for byte, independent of your machine's locale, time zone and default character set. Only removals that cannot change a validation verdict are made, and the keep list is published: type, properties, required, items, prefixItems, enum, const, format, pattern, every size and range bound, multipleOf, additionalProperties when it is false or a subschema, patternProperties, propertyNames, dependentRequired, dependentSchemas, if, then, else, oneOf, anyOf, allOf, not, contains, minContains, maxContains, unevaluatedProperties, unevaluatedItems, $ref, $schema, $id, referenced definitions, and default, deprecated, readOnly and writeOnly. Eleven refusals stop the call and an unchanged retry will not help. MINIFY_SCHEMA_INVALID means schema is absent, is not an object, or holds a reference to a location that is not in the document — send a well-formed schema; MINIFY_SCHEMA_TOO_LARGE means it is over 262144 bytes, so split it; MINIFY_PRESERVE_INVALID means preserve holds a name outside the five published ones or more than five entries, so correct the list; MINIFY_OPTION_INVALID means maxDescriptionChars is outside 0 to 8192 or reportRemovals is not a boolean; MINIFY_TOKENIZER_UNSUPPORTED means the tokenizer id is not one the platform knows, so use cl100k_base or o200k_base; MINIFY_NODE_LIMIT_EXCEEDED means the schema has over 20000 nodes, nests deeper than 64 levels, breaks a per-object cap, or would pass 100000 nodes once its local references were expanded; MINIFY_REF_REMOTE_REFUSED means a reference points outside the document, so inline the target first; MINIFY_REF_CYCLE_DETECTED means the references form a loop; MINIFY_REF_DEPTH_EXCEEDED means a reference chain is longer than 32 hops; MINIFY_WORK_REFUSED means the run was projected past the 2000000-unit budget before it started and reports both numbers; and MINIFY_OUTPUT_TOO_LARGE means the answer would not fit the 2 MiB response ceiling, so set reportRemovals false to drop the itemised list.

Context footprint

The answer carries the shrunken schema plus one short line per removal; set reportRemovals false and only the schema and the counts come back. A successful call costs 2 execution credits.

When to use it

When a schema is about to be handed to a machine and the annotations in it are costing context on every call.

When a person is going to read the schema, or when you want the values inside it redacted rather than the annotations around it removed.

Scope

Note
We return one JSON Schema with the parts that cannot affect validation removed, an itemised list of what went, and the saving in tokens from a named tokenizer.

Non-goals

  • We never remove a keyword that can change a validation verdict
  • We never remove default, deprecated, readOnly or writeOnly — they change behaviour, not size
  • We never reorder keys, rename anything, or rewrite a schema into another shape
  • We never fetch a reference: anything outside the document you sent is refused

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisdata-transformation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call2 credits

File handling

Accepts file_refProduces file_refMax input256 KB

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response may contain submitted or transformed content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
schemaobjectYesJSON Schema to shrink, 2 through 262144 bytes; extra keys are schema keywords and only same-document #/ references resolve. — unconstrained RFC 8259 JSON items.
preservearrayNoAnnotation families to keep, 0 through 5 strings; omit it to keep none of them.
tokenizerstringNoTokenizer id the saving is measured in; omit it for cl100k_base.
maxDescriptionCharsintegerNoKeep and cut descriptions to this many characters, 0 through 8192; omit it for 0 which removes them.
reportRemovalsbooleanNoWhether to itemise every removal; omit it for true.

Output schema

FieldTypeRequiredDescription
minifiedSchemaobjectYesSchema with removable annotations gone and key order unchanged; extra keys are remaining schema keywords. — unconstrained RFC 8259 JSON items.
tokenEstimateobjectYesClosed token saving with originalTokens, minifiedTokens, tokensSaved, the tokenizer identity and CANONICAL_MINIFIED serialisation.
removalsarrayNoItemised changes, 0 through 1000 closed objects; omit the field entirely when reportRemovals is false.
summaryobjectYesClosed counts with removalCount, original and minified bytes, nodeCount, preserved families, truncatedDescriptions and whether the list was capped.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"schema.minify_tool_schema","input":{"schema":{"type":"object","title":"Order","properties":{"id":{"type":"string"}}}}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("schema.minify_tool_schema", {"tokenizer":"cl100k_base","schema":{"title":"Order","type":"object","properties":{"id":{"type":"string","description":"The order identifier.","minLength":0}}}});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
MINIFY_SCHEMA_INVALID400NoThe request payload failed this skill's input validation.
MINIFY_SCHEMA_TOO_LARGE429NoA size, quota, rate, or time limit was exceeded.
MINIFY_PRESERVE_INVALID400NoThe request payload failed this skill's input validation.
MINIFY_OPTION_INVALID400NoThe request payload failed this skill's input validation.
MINIFY_TOKENIZER_UNSUPPORTED400NoThe skill does not support the requested variant.
MINIFY_NODE_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
MINIFY_REF_REMOTE_REFUSED400NoThe request payload failed this skill's input validation.
MINIFY_REF_CYCLE_DETECTED400NoThe request payload failed this skill's input validation.
MINIFY_REF_DEPTH_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
MINIFY_WORK_REFUSED429NoA size, quota, rate, or time limit was exceeded.
MINIFY_OUTPUT_TOO_LARGE429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • We never remove a keyword that can change a validation verdict
  • We never remove default, deprecated, readOnly or writeOnly — they change behaviour, not size
  • We never reorder keys, rename anything, or rewrite a schema into another shape
  • We never fetch a reference: anything outside the document you sent is refused
  • Producing a schema for humans to read
  • Removing sample values that carry secrets, which schema.redact_schema_samples does

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "schema.minify_tool_schema",
  "input": {
    "tokenizer": "cl100k_base",
    "schema": {
      "title": "Order",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The order identifier.",
          "minLength": 0
        }
      }
    }
  }
}

Examples

An annotated schema stripped to its constraints

Inputjson
{
  "tokenizer": "cl100k_base",
  "schema": {
    "title": "Order",
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "The order identifier.",
        "minLength": 0
      }
    }
  }
}
Expected outputjson
{
  "summary": {
    "removalCount": 3,
    "originalBytes": 123,
    "minifiedBytes": 55,
    "nodeCount": 8,
    "preserved": [],
    "truncatedDescriptions": 0,
    "truncated": false
  },
  "removals": [
    {
      "pointer": "/title",
      "keyword": "title",
      "reason": "ANNOTATION",
      "action": "REMOVED"
    },
    {
      "pointer": "/properties/id/description",
      "keyword": "description",
      "reason": "ANNOTATION",
      "action": "REMOVED"
    },
    {
      "pointer": "/properties/id/minLength",
      "keyword": "minLength",
      "reason": "REDUNDANT_DEFAULT_VALUE",
      "action": "REMOVED"
    }
  ],
  "tokenEstimate": {
    "originalTokens": 28,
    "minifiedTokens": 14,
    "tokensSaved": 14,
    "tokenizer": {
      "id": "cl100k_base",
      "family": "byte-level-bpe",
      "engineId": "jtokkit",
      "libraryVersion": "jtokkit-1.1.0"
    },
    "serialization": "CANONICAL_MINIFIED"
  },
  "minifiedSchema": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      }
    }
  }
}

Descriptions kept, dead definitions dropped, list suppressed

Inputjson
{
  "schema": {
    "type": "object",
    "description": "An order.",
    "properties": {
      "id": {
        "type": "string",
        "description": "The order identifier."
      }
    },
    "$defs": {
      "unused": {
        "type": "integer"
      }
    }
  },
  "reportRemovals": false,
  "preserve": [
    "DESCRIPTIONS"
  ]
}
Expected outputjson
{
  "summary": {
    "removalCount": 2,
    "originalBytes": 157,
    "minifiedBytes": 119,
    "nodeCount": 10,
    "preserved": [
      "DESCRIPTIONS"
    ],
    "truncatedDescriptions": 0,
    "truncated": false
  },
  "tokenEstimate": {
    "originalTokens": 36,
    "minifiedTokens": 25,
    "tokensSaved": 11,
    "tokenizer": {
      "id": "cl100k_base",
      "family": "byte-level-bpe",
      "engineId": "jtokkit",
      "libraryVersion": "jtokkit-1.1.0"
    },
    "serialization": "CANONICAL_MINIFIED"
  },
  "minifiedSchema": {
    "type": "object",
    "description": "An order.",
    "properties": {
      "id": {
        "type": "string",
        "description": "The order identifier."
      }
    }
  }
}
  • Shrink a tool schema before publishing it to agents that pay for it every turn
  • Measure how much of a schema's size is documentation rather than constraint
  • Strip a schema for a machine consumer while keeping the annotated copy in Git

Avoid for

  • Producing a schema for humans to read
  • Removing sample values that carry secrets, which schema.redact_schema_samples does

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

cleanupjsonschematransformation