Weekly content calendar as JSON: a Sume Format output schema

Bind a JSON Schema to a Sume Format run and get a seven-day content calendar back as validated JSON, with real dates, enums and media references.

4 min readSume
All posts

How do I get a weekly calendar back as JSON, not prose?

Pass output_schema on the run. Sume validates the result after the run with Ajv, and output comes back only if it satisfies the schema. A violation gives output_schema_unsatisfied and output_error, with output set to null, so your spreadsheet import never sees a half-valid calendar. That check is the reason to prefer a schema over asking nicely in the instruction: a calendar with six days, a misspelled weekday or a date such as 2026-13-01 fails loudly instead of landing in a Google Sheet unnoticed.

The strict subset has rules worth knowing up front: the root must be an object, every object needs additionalProperties: false, and every property must appear in required. Optional means a nullable union such as ["string", "null"]. oneOf, allOf and nullable are rejected.

What does a seven-day schema look like?

The keywords minItems, maxItems, enum, format and pattern are all enforced after the run, so the schema can insist on exactly seven days, a fixed set of weekday names and a real date. A video the agent generated can be returned with the media reference SumeMediaFile#.

{
  "type": "object",
  "additionalProperties": false,
  "required": ["week_of", "days"],
  "properties": {
    "week_of": {"type": "string", "format": "date"},
    "days": {
      "type": "array", "minItems": 7, "maxItems": 7,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["weekday", "date", "caption", "video"],
        "properties": {
          "weekday": {"enum": ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]},
          "date": {"type": "string", "format": "date"},
          "caption": {"type": "string", "maxLength": 150},
          "video": {"$ref": "SumeMediaFile#"}
        }
      }
    }
  }
}

What limits apply, and what fills the fields?

Each field is filled either by the agent or by a projection step. The projection never sees input, so any value that depends on your request, such as the Monday date, belongs in the instruction or must be something the agent produced. Schemas are limited to depth 10, 5,000 properties and 120,000 total string characters.

Send output_schema or the OpenAI-style response_format, never both: that is a 400.

  • Put the start date in the instruction so the agent can emit real dates.
  • Keep captions under a character limit with maxLength, and check it at the receiver anyway.
  • Treat a null output as a failed run, not as an empty week.
  • Add $ref to SumeMediaFile# only where a generated file belongs.

Sources

Related posts

More in Formats

All Formats posts

Written by Sume