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

FieldDescriptionRequired
NameUnique identifier for the endpointYes
ModulePython module containing the functionYes
DescriptionWhat this endpoint does (for AI selection)Yes
InputsReferences to agent inputs used by this endpointNo
OutputsReferences to agent outputs producedNo
TimeoutMaximum execution time in secondsNo (default: 300)
EnabledWhether this endpoint is availableNo (default: true)

Endpoint Naming

Endpoints are referenced using the format:

agent_alias.module.function_name

For 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:

Example Endpoint Configuration
{
    "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:

Accessing secrets in code
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