Frontmatter Extractor
text.extract_frontmatter
Overview
Detects and parses frontmatter at the start of a Markdown document (YAML '---', TOML '+++', or a leading JSON object). Returns parsed metadata, format, offsets, and the remaining body. Parsers run in safe mode with a bounded frontmatter size.
Markdown metadata lives in frontmatter blocks. We parse the leading fence safely so you get structured fields without hallucinated structure.
Reliability
STRICT and deterministic — identical markdown and options always produce the same result. Parsers run in safe mode with a 256 KB frontmatter cap, and TOML support covers the frontmatter subset — top-level pairs, single-level [table] headers, and scalar arrays — reporting anything else in warnings. An opening fence with no matching close is treated as ordinary Markdown, so you get found: false rather than an error. Input validation (not retryable): a formats array with none of yaml, toml, json; frontmatter we cannot parse; frontmatter over 256 KB; markdown over 2,000,000 characters.
Context footprint
Bounded input (2 MB) and frontmatter (256 KB); parses only the leading block at the document start. A successful call costs 1 execution credit.
When to use it
When you need the metadata block at the top of a Markdown document, with optional raw block and body separation.
Do not use when metadata is embedded in the body or you need full Markdown AST parsing.
Scope
Non-goals
- Does not parse Markdown body structure (headings, lists, links)
- Does not detect frontmatter after headings or mid-document blocks
- Does not resolve custom YAML tags into Java types
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
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 does not contain submitted 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 |
|---|---|---|---|
| markdown | string | Yes | Markdown document whose leading metadata block is inspected. |
| formats | array | No | Bounded optional format array; omit it to try JSON, YAML, and TOML in the documented order. The item shape is defined by the nested schema and the array contains from 0 through 3 items. |
| includeBody | boolean | No | Whether the body is returned; omit it for true. |
| includeRaw | boolean | No | Whether the raw block is returned; omit it for false. |
| parseValues | boolean | No | Whether metadata values are parsed; omit it for true. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| found | boolean | Yes | Whether a leading metadata block was found. |
| format | string | No | Detected frontmatter format. |
| data | object | No | Purpose-bound parsed frontmatter object; keys and JSON-compatible values come from the document. Its purpose-bound receipt properties are bounded to 64 entries — unconstrained RFC 8259 JSON items. |
| raw | string | No | Exact frontmatter source block including fences. |
| body | string | No | Unmodified Markdown body after the metadata block. |
| startChar | integer | No | Zero-based metadata start offset. |
| endChar | integer | No | Zero-based body start offset. |
| warnings | array | Yes | Bounded warning array containing from 0 through 10000 items, where each item is one non-fatal advisory string. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"text.extract_frontmatter","input":{"markdown":"---\ntitle: Hello\n---\n# Body"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("text.extract_frontmatter", {"markdown":"---\ntitle: Hello\n---\n# Body\n"});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. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not parse Markdown body structure (headings, lists, links)
- Does not detect frontmatter after headings or mid-document blocks
- Does not resolve custom YAML tags into Java types
- Full Markdown AST parsing
- Metadata blocks not at the document start
- Inline metadata in the body rather than a leading frontmatter fence
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "text.extract_frontmatter",
"input": {
"markdown": "---\ntitle: Hello\n---\n# Body\n"
}
}Examples
YAML frontmatter with body
{
"markdown": "---\ntitle: Hello\n---\n# Body\n"
}{
"startChar": 0,
"warnings": [],
"endChar": 21,
"data": {
"title": "Hello"
},
"found": true,
"format": "yaml",
"body": "# Body\n"
}Document without frontmatter
{
"includeBody": true,
"markdown": "No frontmatter here\n"
}{
"found": false,
"warnings": []
}Recommended use cases
- Read title, tags, or dates from blog posts and docs
- Split metadata from body before rendering or indexing
- Extract config embedded at the top of a Markdown file
Avoid for
- Full Markdown AST parsing
- Metadata blocks not at the document start
- Inline metadata in the body rather than a leading frontmatter fence
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.