Headers in Visual Builder
Copy page
Configure HTTP headers in the Visual Builder to pass dynamic context for personalized agent interactions.
Overview
Headers allow you to pass request-specific values (like user IDs, authentication tokens, or organization metadata) to your agent at runtime via HTTP headers. These values are validated and made available throughout your agent system for:
- Context Fetchers: Dynamic data retrieval based on request values
- External Tools: Authentication and personalization for API calls
- Agent Prompts: Personalized responses using context variables
Configuring Headers
- Go to the Agents tab in the left sidebar. Then click on the agent you want to configure.
- On the right pane scroll down to the "Headers schema" section.
- Enter the schema in JSON Schema format.
- Click on the "Save" button.
Here is an example of a valid headers schema:
Header keys are normalized to lowercase before validation. Always define schema properties in lowercase (e.g., user_id, not userId). A casing mismatch will cause a Context validation failed error.
You can generate custom schemas using this JSON Schema generator.
Sending Custom Headers
- On your agent page, click on the Try it button in the top right corner.
- Click on the "Custom headers" button in the top right corner.
- Enter the custom headers in JSON format.
- Click on the "Apply" button.
Header Validation
When you enter custom headers in the playground, they are validated in real-time against the configured headers schema. If the headers are invalid or missing required fields, the chat input is disabled and an error message is displayed. You must fix validation errors before you can send messages.
Using Headers in Your Agent Prompts
- Go to the Agents tab in the left sidebar. Then click on the agent you want to configure.
- Either add a new agent or edit an existing agent by clicking on the agent you want to edit.
- On the right pane scroll down to the "Prompt" section.
- Use the double curly braces
{{}}to reference the headers variables.
Here is an example of a valid prompt:
Forwarding Headers to MCP Servers
You can forward header values to MCP servers using {{headers.*}} templates. These templates are resolved at runtime from the incoming request headers before each tool call.
- Define the header in your agent's headers schema (use lowercase keys)
- Register the MCP server — leave the Credential field blank if auth comes entirely from forwarded headers
- Connect the MCP server to a Sub Agent, then click on the connection. In the Headers field, reference the schema properties:
See MCP Servers — Dynamic credential pass-through for more on authentication.