Skip to main content
Four working .prompt.mdx examples you can drop into your agentmark/ directory and run with npx @agentmark-ai/cli run-prompt. Each one covers a different generation type and a different AgentMark feature. Pick the closest to what you’re building and adapt.
npm create agentmark bootstraps agentmark.json, an empty agentmark/ directory, and MCP wiring. Copy any example below into agentmark/ to get started.

Before you run these

All four examples assume a working local setup:
  1. A client file (agentmark.client.ts for TypeScript, agentmark_client.py for Python) in your project root. npm create agentmark does not create one; ask your coding agent to “Set up AgentMark in this project,” or follow Client setup. Without it, the development server exits with Error: agentmark.client.ts not found in current directory.
  2. The development server running in a second terminal: npx @agentmark-ai/cli dev.
  3. A provider API key in .env. Every example below uses OpenAI models, so set OPENAI_API_KEY.
Structured JSON output, schema validation, and a linked dataset with an eval. This is the canonical “extract this shape from text” prompt.Demonstrates: object_config, JSON schema validation, test_settings.dataset, test_settings.evals (exact_match_json).
exact_match_json references an eval by name. You have to register an eval with that name in your client’s evals registry before run-experiment will score anything; unregistered eval names are silently skipped, so the run completes with no scores and no error. See Writing evals for the wiring.
agentmark/party-planner.prompt.mdx
---
name: party-planner
object_config:
  model_name: openai/gpt-5-mini
  schema:
    type: object
    properties:
      names:
        type: array
        description: "List of names of people attending the party."
        items:
          type: string
    required:
      - names
test_settings:
  dataset: party.jsonl
  evals:
    - exact_match_json
  props:
    party_text: "We're having a party with Alice, Bob, and Carol."
input_schema:
  type: object
  properties:
    party_text:
      type: string
      description: "A block of text describing the upcoming party and attendees."
  required:
    - party_text
---

<System>
Extract the names of all people attending the party from the following text. Respond with a list of names only.
</System>

<User>
Text: {props.party_text}
</User>
agentmark/party.jsonl
{"input": {"party_text": "We're having a party with Alice, Bob, and Carol."}, "expected_output": "{\"names\": [\"Alice\", \"Bob\", \"Carol\"]}"}
{"input": {"party_text": "The guest list includes Dave, Emma, and Frank."}, "expected_output": "{\"names\": [\"Dave\", \"Emma\", \"Frank\"]}"}
{"input": {"party_text": "Join us for a celebration with Grace, Henry, and Isla."}, "expected_output": "{\"names\": [\"Grace\", \"Henry\", \"Isla\"]}"}
Run it
# Single execution against the inline test_settings.props:
npx @agentmark-ai/cli run-prompt agentmark/party-planner.prompt.mdx

# Full dataset with the exact_match_json eval:
npx @agentmark-ai/cli run-experiment agentmark/party-planner.prompt.mdx

Wiring these into your project

Drop the .prompt.mdx file into <your-project>/agentmark/ (the agentmark/ directory npm create agentmark left empty). Drop the .jsonl dataset next to it. Then either run from the CLI as shown in each “Run it” block, or load by name from your SDK client. If you ran npm create agentmark and then asked your AI tool to “Set up AgentMark in this project,” the setup workflow will have proposed the right SDK package and client file for your stack. The recipes above slot into that wiring directly.

Next steps

Create a prompt

Author your own .prompt.mdx files from scratch

Generation types

Reference for text, object, image, and speech configs

Tools and agents

Wire tool implementations into prompts (used in customer-support)

Running experiments

Datasets + evals (used in party-planner)

Have questions?

Reach out any time: