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
Tags
| Tag | Description |
|---|---|
<System> | System-level instructions |
<User> | User message |
<Assistant> | Assistant message (optional — include for few-shot examples) |
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
$ref syntax, transitive references, and JSON Pointer fragments.
Available configuration
| Property | Type | Description | Required |
|---|---|---|---|
model_name | string | The name of the model to use for object generation. | Yes |
schema | JSONSchema | Schema defining the expected structure of the model’s output. Supports $ref for reusable definitions. | Yes |
max_tokens | number | Maximum number of tokens to generate. | No |
temperature | number | Controls the randomness of the output; higher values are more random. | No |
max_calls | number | Maximum number of LLM calls allowed. | No |
top_p | number | Cumulative probability for nucleus sampling. | No |
top_k | number | Limits next-token selection to the top k tokens. | No |
presence_penalty | number | Penalizes tokens based on presence in the text so far. | No |
frequency_penalty | number | Penalizes tokens based on frequency in the text so far. | No |
stop_sequences | string[] | Strings that, if encountered, stop generation. | No |
seed | number | Random-number seed for reproducibility. | No |
max_retries | number | Maximum number of retries on failure. | No |
schema_name | string | Name sent with the schema (used by OpenAI structured outputs). | No |
schema_description | string | Description sent with the schema. | No |
tools | string[] | List of tool names or MCP URIs available to the model. | No |
Running an object prompt
See Running prompts → Object generation for the SDK code patterns forgenerateObject / streamObject (TypeScript) and run_object_prompt (Python).
Have Questions?
We’re here to help! Choose the best way to reach us:
- Email us at hello@agentmark.co for support
- Schedule an Enterprise Demo to learn about our business solutions