Agent Architecture
Every agent must implement 2 required endpoints (GET /tools and POST /tools/:toolName) and 1 optional endpoint (POST /resource):1. GET /tools (Required)
Returns available tools for the agent. Response Type:ToolsResponseDto
⚠️ Important: Reserved Keywords
When defining tool parameters, be aware that certain keywords are reserved by the system and cannot be used as property names. Using these reserved keywords will result in validation errors Following keywords are reserved:💡 Tip: If you need to use a similar concept, consider prefixing or suffixing the property name Example:
executionId
chatId
userId
toolName
2. POST /tools/:toolName (Required)
Executes a specific tool with provided parameters. Parameters:toolName
(path parameter): Name of the tool to execute- Request body: Tool-specific parameters
BaseErrorResponseDto | BaseSuccessResponseDto<any>
3. POST /resource (Optional)
Provides contextual information about the current user or environment to help the agent work effectively. Example Use Cases:- GitHub agent: Return user’s profile and repositories
- MongoDB agent: Return database schema information
- Slack agent: Return user’s workspace info and frequent contacts
Authentication
All requests include authentication headers:API Key Authentication
- Header:
x-api-key
- Used to authenticate the server making the request
- Required for all endpoints
OAuth Authentication (Optional)
- Header:
x-api-key
- Used to authenticate the server making the request
- Required for all endpoints
- Header:
Authorization: Bearer <token>
- Used for agents requiring user-specific OAuth tokens
- Examples: Twitter, Slack, GitHub agents
Variable Headers (Optional)
- Header:
x-api-key
- Used to authenticate the server making the request
- Required for all endpoints
- Header:
x-<variablename>
- Used for agent-specific configuration
- Example:
x-dburi
for MongoDB agent
Tool Definition Structure
Each tool in theToolsResponseDto
follows this structure:
Best Practices
- Error Handling: Always return proper error responses using
BaseErrorResponseDto
- Parameter Validation: Validate all input parameters according to the tool schema
- Authentication: Implement proper guards for API key and OAuth validation
- Documentation: Provide clear descriptions for tools and parameters
- Response Types: Use appropriate response types (text, html, media, mixed)
- Confirmation: Set
confirmationRequired: true
for critical operations