Skip to main content
AgentMark generates structured objects with prompts that declare object_config in frontmatter and a JSON schema for the expected output. Object prompts use the same message-role tags as text prompts.

Example configuration

example.prompt.mdx
OpenAI strict structured output requires additionalProperties: false on every object in your schema (the root and each nested object) and a required list naming all of that object’s properties. Zod’s z.object().strict() emits this for you; a hand-written or migrated JSON-schema schema block doesn’t, so it’s the most common Zod→frontmatter migration trap. Omit it and OpenAI rejects the request with a strict-schema validation error. (Providers without strict mode ignore the field, so it’s always safe to add.)

Tags

Using schema references

Instead of writing a full schema inline, you can extract it into a .json file and use $ref to reference it. AgentMark resolves the reference at build time.
extract-event.prompt.mdx
See Schema references for full documentation on $ref syntax, transitive references, and JSON Pointer fragments.

Available configuration

Running an object prompt

See the SDK usage section of Running prompts (under the Local tab) for the object-generation SDK code patterns: render the prompt with prompt.format(), then make your own structured-output call (generateObject / streamObject in TypeScript, the OpenAI client in Python).

Have questions?

Reach out any time: