Skip to main content

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

  1. Log in to your Connect dashboard
  2. Click on your profile icon in the top right corner
  3. Select "Developer Tools" from the dropdown menu

Uploading Your Integration for Testing

The testing interface allows you to upload and test your integration files:

  1. JavaScript Files: Upload your main.js or index.js file along with any other JavaScript files your integration requires

    • You must include either main.js or index.js as your entry point
    • You can add multiple JavaScript files if your integration is modular
  2. 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:

  1. Validate your integration.json file
  2. Check for required fields (name, description, version, tools)
  3. Load your JavaScript files
  4. Register your tools with the Connect environment
  5. Make your integration available for immediate testing in the agent chat interface

Live Testing with an Agent

After submitting your integration for testing:

  1. The platform will store your integration temporarily in local storage
  2. You'll be automatically redirected to a chat interface with an agent
  3. Your integration's tools will be available to the agent
  4. You can ask the agent to use your integration's tools to verify they work correctly
  5. All tool invocations, parameters, and results are displayed in the chat

Integration Requirements

Your integration must meet these requirements to test successfully:

Required Files

  1. Entry Point: Either main.js or index.js as the main file
  2. 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:

  1. Register tools using the connect.tools.register method
  2. Implement each tool defined in your integration.json
  3. Handle parameters according to your tool's parameter schema
  4. 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:

  1. Console Logging: Use console.log() in your code and check the browser console for output
  2. Error Display: Any errors in your integration will be displayed in the chat interface
  3. 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:

  1. The tool name in connect.tools.register matches exactly with the name in integration.json
  2. Your entry point file (main.js or index.js) is properly uploaded
  3. There are no JavaScript errors preventing tool registration

Parameter Errors

If your tool receives incorrect parameters:

  1. Verify the parameter schema in your integration.json
  2. Make sure required parameters are properly defined
  3. Check how the agent is passing parameters to your tool

JavaScript Errors

Common JavaScript issues include:

  1. Syntax errors in your code
  2. Attempting to use Node.js APIs that aren't available in the browser
  3. Missing dependencies or imports
  4. Failing to handle asynchronous operations properly

Best Practices

  1. Test Incrementally: Start with simple tools and add complexity gradually
  2. Validate Parameters: Always check that required parameters exist and have the right format
  3. Provide Clear Errors: Return helpful error messages when things go wrong
  4. Keep Tools Focused: Each tool should do one thing well
  5. 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.