Create a new agent type.
Returns: Created agent type with server-populated fields.
Raises: AgentTypeAlreadyExistsError: If name already taken in organization.
Request body for creating an agent type.
Attributes: name: Machine-readable name unique within organization. display_name: Human-readable name shown in UI. description: Agent purpose and capabilities. icon: Icon identifier or URL. provider: LLM provider (e.g., "anthropic", "openai"). model: Model identifier (e.g., "claude-opus-4", "gpt-4"). temperature: Sampling temperature for generation. context_window: Maximum context window size in tokens. system_instructions: System prompt for the agent. mcp_servers: MCP server identifiers available to the agent. builtin_tools: Built-in tool identifiers available to the agent. default_plan_template: Default plan steps for new tasks. agent_resource_id: SurrealDB resource ID for the agent type. runner_resource_id: SurrealDB resource ID for the runner resource. conversation_routing: Routing rules for conversation assignment.
Routing rules for conversation-to-agent assignment.
Attributes: when: Natural language description of when this agent should handle a conversation. examples: Example messages that should route to this agent. avoid: Natural language description of messages this agent should not handle.
Successful Response
Domain model for agent types with LLM configuration and tooling.
Identity fields (frozen - immutable after creation): name: Machine-readable name unique within organization. organization_id: Tenant that owns this agent type.
Configuration fields (mutable): display_name: Human-readable name shown in UI. description: Agent purpose and capabilities. icon: Icon identifier or URL. provider: LLM provider (e.g., "anthropic", "openai"). model: Model identifier (e.g., "claude-opus-4", "gpt-4"). temperature: Sampling temperature for generation. context_window: Maximum context window size in tokens. system_instructions: System prompt for the agent. mcp_servers: MCP server identifiers available to the agent. builtin_tools: Built-in tool identifiers available to the agent. default_plan_template: Default plan steps for new tasks. conversation_routing: Routing rules for conversation assignment.
Resource fields (linking to pragma resources): agent_resource_id: SurrealDB resource ID for the agent type. runner_resource_id: SurrealDB resource ID for the runner resource.
Audit fields: created_by: User ID of the creator. version: Schema version for migration support.
Inherited from PragmaModel: created_at: Creation timestamp (frozen). updated_at: Last update timestamp (mutable).
Routing rules for conversation-to-agent assignment.
Attributes: when: Natural language description of when this agent should handle a conversation. examples: Example messages that should route to this agent. avoid: Natural language description of messages this agent should not handle.