Testing Your Integrations
This guide explains how to test your Connect integrations within the platform to ensure they work correctly before deployment.
Testing with the Connect Platform
Connect provides a built-in testing mechanism that allows you to test your integrations directly in the platform before uploading them to the integration marketplace or adding them to your agents.
How to Access the Integration Testing Tool
- Log in to your Connect dashboard
- Click on your profile icon in the top right corner
- Select "Developer Tools" from the dropdown menu
Uploading Your Integration for Testing
The testing interface allows you to upload and test your integration files:
-
JavaScript Files: Upload your
main.js
orindex.js
file along with any other JavaScript files your integration requires- You must include either
main.js
orindex.js
as your entry point - You can add multiple JavaScript files if your integration is modular
- You must include either
-
JSON Configuration: Upload or paste your
integration.json
file- The platform will validate your JSON against the required schema
- Any validation errors will be displayed immediately
Testing Process
When you click "Test Integration", the platform will:
- Validate your
integration.json
file - Check for required fields (name, description, version, tools)
- Load your JavaScript files
- Register your tools with the Connect environment
- Make your integration available for immediate testing in the agent chat interface
Live Testing with an Agent
After submitting your integration for testing:
- The platform will store your integration temporarily in local storage
- You'll be automatically redirected to a chat interface with an agent
- Your integration's tools will be available to the agent
- You can ask the agent to use your integration's tools to verify they work correctly
- All tool invocations, parameters, and results are displayed in the chat
Integration Requirements
Your integration must meet these requirements to test successfully:
Required Files
- Entry Point: Either
main.js
orindex.js
as the main file - Integration Configuration:
integration.json
with the following structure:
{
"name": "Integration Name",
"description": "Description of what your integration does",
"version": "1.0.0",
"author": "Your Name",
"tools": [
{
"name": "toolName",
"description": "Description of what this tool does",
"parameters": {
"type": "object",
"properties": {
"paramName": {
"type": "string",
"description": "Description of this parameter"
}
},
"required": ["paramName"]
}
}
]
}
JavaScript Implementation
Your JavaScript files should:
- Register tools using the
connect.tools.register
method - Implement each tool defined in your
integration.json
- Handle parameters according to your tool's parameter schema
- Return results in a format that can be used by the agent
Example implementation:
// Define your tool function
function myToolFunction(params) {
// Extract parameters
const { paramName } = params;
// Perform the tool's functionality
const result = `Processed ${paramName}`;
// Return the result
return { result };
}
// Register the tool with Connect
connect.tools.register('toolName', myToolFunction);
Debugging Tools
The Connect platform provides several debugging capabilities:
- Console Logging: Use
console.log()
in your code and check the browser console for output - Error Display: Any errors in your integration will be displayed in the chat interface
- Tool Execution Logs: The platform shows the tool invocation data, parameters, and results
Common Testing Issues
Tool Not Found
If your agent can't find your tool, check:
- The tool name in
connect.tools.register
matches exactly with the name inintegration.json
- Your entry point file (
main.js
orindex.js
) is properly uploaded - There are no JavaScript errors preventing tool registration
Parameter Errors
If your tool receives incorrect parameters:
- Verify the parameter schema in your
integration.json
- Make sure required parameters are properly defined
- Check how the agent is passing parameters to your tool
JavaScript Errors
Common JavaScript issues include:
- Syntax errors in your code
- Attempting to use Node.js APIs that aren't available in the browser
- Missing dependencies or imports
- Failing to handle asynchronous operations properly
Best Practices
- Test Incrementally: Start with simple tools and add complexity gradually
- Validate Parameters: Always check that required parameters exist and have the right format
- Provide Clear Errors: Return helpful error messages when things go wrong
- Keep Tools Focused: Each tool should do one thing well
- Document Thoroughly: Include clear descriptions in your
integration.json
By following these testing guidelines, you can ensure your integration works reliably before sharing it with others or adding it to your production agents.