Overview
Functions are HTTP endpoints that SATE can call to perform actions on your behalf. They extend your SATE capabilities beyond simple knowledge retrieval to include real-time data access and system interactions.Current Capabilities
Currently, only 
GET functions are supported. Support for POST, PATCH, and DELETE methods is coming soon. MCP (Model Context Protocol) support is also planned.Creating a Function
Navigate to the DevSpace platform and follow these steps:1
Access Functions
Click the “Functions” tab in your DevSpace dashboard
2
Add New Function
Click “Add new function” to start the creation process
3
Configure Function
Fill in the required function details
Function Configuration
When creating a function, provide the following information:Basic Information
A clear, descriptive name for your function (e.g., “get_order_status”)
Detailed description of what the function does and when Sate should use it
The complete URL of your HTTP endpoint. Path and query parameters will be automatically extracted from the URL.
Parameter Configuration
For each parameter automatically detected from your URL, you need to configure:Clear description of what this parameter represents
The parameter data type: 
string, boolean, or numberWho provides this parameter value:
organisation: You provide the valuesate: SATE determines the value from context
Organization-Provided Parameters
When you selectorganisation as the provider, you have two options:
- Direct Value: Provide a static value for the parameter
 - Leaf Function: Reference another function that returns the parameter value
 
Using Leaf Functions
A leaf function is a simple function without any parameters that returns data. Requirements:- Must be a function without path or query parameters
 - If the main function is unauthenticated, the leaf function must also be unauthenticated
 - You can optionally specify a 
response_pathto extract specific data from the leaf function’s response 
Security & Environment
Whether this function requires customer authentication
Set to “live” for customer use or “dev” for testing only
Function Examples
Simple Function (No Parameters)
- Name: 
get_store_hours - Description: “Returns current store operating hours and holiday schedules”
 - Authentication: Not required
 - Environment: Live
 
Function with Sate-Provided Parameters
- Name: 
get_order_details - Description: “Retrieves detailed information about a specific customer order”
 - Authentication: Required
 - Environment: Live
 
order_id(string): The unique order identifier- Provider: 
SATEwill extract from customer conversation - Description: “Customer’s order ID they’re asking about”
 
- Provider: 
 
Function with Organization-Provided Parameters
- Name: 
get_products_by_category - Description: “Retrieves products filtered by category with pagination”
 - Authentication: Not required
 - Environment: Live
 
category(string): Product category to filter by- Provider: 
SATEdetermines from customer request - Description: “Product category the customer is interested in”
 
- Provider: 
 limit(number): Maximum number of products to return- Provider: 
organisation(you set a static value like 20) - Description: “Number of products to return per request”
 
- Provider: 
 
Function Using Leaf Function
- Name: 
get_user_preferences - Description: “Retrieves user preferences for a specific store”
 - Authentication: Required
 - Environment: Live
 
user_id(string): The user’s unique identifier- Provider: 
SATEgets from authentication context - Description: “ID of the authenticated user”
 
- Provider: 
 store_id(string): The store location identifier- Provider: 
organisation(use leaf function) - Leaf Function: 
get_default_store(returns store information) - Response Path: 
store.id(extracts store ID from response) 
- Provider: 
 
Best Practices
Function Naming
- Use clear, action-oriented names
 - Follow consistent naming conventions
 - Include the resource being accessed (e.g., 
get_user_orders,check_inventory_status) 
Descriptions
- Explain when Sate should use this function
 - Describe the expected response format
 - Include any important limitations or requirements
 
Parameter Configuration
- Choose the appropriate provider (
satevsorganisation) for each parameter - Use leaf functions for dynamic organization-provided values
 - Provide clear descriptions to help Sate understand parameter usage
 - Use appropriate data types (string, number, boolean) for validation
 
Response Handling
Your endpoints should return structured JSON responses that Sate can easily interpret:Ensure your endpoints handle errors gracefully and return appropriate HTTP status codes.
Testing Functions
Before deploying functions to production:- Test endpoints independently - Verify your APIs work correctly
 - Use development environment - Set functions to “dev” mode initially
 - Test authentication flow - Ensure auth integration works properly
 - Validate with Sate - Test the complete interaction flow
 
Monitoring and Debugging
Monitor your function usage through:- Server logs for your endpoints
 - DevSpace analytics (coming soon)
 - Customer interaction feedback
 
Next Steps
- Set up authentication for protected functions
 - Review API reference for callback endpoints