Endpoints
Define callable functions and configure their behavior.
What are Endpoints?
Endpoints are the callable entry points into your agent. Each endpoint maps to a Python function that can be invoked during execution. An agent can have multiple endpoints, each performing a different action.
Example: A "Database Agent" might have endpoints like query, backup, and health_check.
Endpoint Structure
| Field | Description | Required |
|---|---|---|
| Name | Unique identifier for the endpoint | Yes |
| Module | Python module containing the function | Yes |
| Description | What this endpoint does (for AI selection) | Yes |
| Inputs | References to agent inputs used by this endpoint | No |
| Outputs | References to agent outputs produced | No |
| Timeout | Maximum execution time in seconds | No (default: 300) |
| Enabled | Whether this endpoint is available | No (default: true) |
Endpoint Naming
Endpoints are referenced using the format:
agent_alias.module.function_nameFor example, if your agent has alias db_agent and you have a function health_check in agent.py, the full endpoint would be: db_agent.agent.health_check
Input Mapping
Endpoints reference global agent inputs. When configuring an endpoint, you specify which inputs the function requires:
{
"name": "query",
"module": "agent",
"description": "Execute a SQL query on the database",
"inputs": ["database_name", "query_string"],
"outputs": ["result"],
"timeout": 60
}Enabling and Disabling Endpoints
You can enable or disable individual endpoints without modifying code:
Enabled
Endpoint is available for execution and AI selection.
Disabled
Endpoint exists but won't be used in execution.
Using Secrets
Endpoints can reference secrets stored in the Vault. Secrets are injected as environment variables at runtime:
import os
def query_database(query_string: str) -> dict:
# Secret is injected as environment variable
db_password = os.environ.get("DB_PASSWORD")
# Use the secret in your code
connection = connect(password=db_password)
...Best Practices
- Write clear descriptions—the AI uses them to select endpoints
- Set appropriate timeouts based on expected execution time
- Use secrets for credentials—never hardcode sensitive values
- Keep endpoints focused on a single action
- Disable deprecated endpoints instead of deleting them