Tool Schema Minifier
schema.minify_tool_schema
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
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
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
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.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| schema | object | Yes | JSON Schema to shrink, 2 through 262144 bytes; extra keys are schema keywords and only same-document #/ references resolve. — unconstrained RFC 8259 JSON items. |
| preserve | array | No | Annotation families to keep, 0 through 5 strings; omit it to keep none of them. |
| tokenizer | string | No | Tokenizer id the saving is measured in; omit it for cl100k_base. |
| maxDescriptionChars | integer | No | Keep and cut descriptions to this many characters, 0 through 8192; omit it for 0 which removes them. |
| reportRemovals | boolean | No | Whether to itemise every removal; omit it for true. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| minifiedSchema | object | Yes | Schema with removable annotations gone and key order unchanged; extra keys are remaining schema keywords. — unconstrained RFC 8259 JSON items. |
| tokenEstimate | object | Yes | Closed token saving with originalTokens, minifiedTokens, tokensSaved, the tokenizer identity and CANONICAL_MINIFIED serialisation. |
| removals | array | No | Itemised changes, 0 through 1000 closed objects; omit the field entirely when reportRemovals is false. |
| summary | object | Yes | Closed counts with removalCount, original and minified bytes, nodeCount, preserved families, truncatedDescriptions and whether the list was capped. |
API contract
POST /v1/executecurl -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"}}}}}'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
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| MINIFY_SCHEMA_INVALID | 400 | No | The request payload failed this skill's input validation. |
| MINIFY_SCHEMA_TOO_LARGE | 429 | No | A size, quota, rate, or time limit was exceeded. |
| MINIFY_PRESERVE_INVALID | 400 | No | The request payload failed this skill's input validation. |
| MINIFY_OPTION_INVALID | 400 | No | The request payload failed this skill's input validation. |
| MINIFY_TOKENIZER_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
| MINIFY_NODE_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| MINIFY_REF_REMOTE_REFUSED | 400 | No | The request payload failed this skill's input validation. |
| MINIFY_REF_CYCLE_DETECTED | 400 | No | The request payload failed this skill's input validation. |
| MINIFY_REF_DEPTH_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| MINIFY_WORK_REFUSED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| MINIFY_OUTPUT_TOO_LARGE | 429 | No | A size, quota, rate, or time limit was exceeded. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 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)
{
"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
{
"tokenizer": "cl100k_base",
"schema": {
"title": "Order",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The order identifier.",
"minLength": 0
}
}
}
}{
"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
{
"schema": {
"type": "object",
"description": "An order.",
"properties": {
"id": {
"type": "string",
"description": "The order identifier."
}
},
"$defs": {
"unused": {
"type": "integer"
}
}
},
"reportRemovals": false,
"preserve": [
"DESCRIPTIONS"
]
}{
"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."
}
}
}
}Recommended use cases
- 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
Related skills
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.