Resources
Resources represent external systems that tools can interact with.
Overview
Section titled “Overview”Synatra supports five resource types:
| Resource Type | Description | Connection Mode |
|---|---|---|
| PostgreSQL | Connect to PostgreSQL databases | Direct or Connector |
| MySQL | Connect to MySQL databases | Direct or Connector |
| Stripe | Access Stripe payment APIs | Direct only |
| GitHub | Access GitHub repository APIs | Direct only (OAuth) |
| Intercom | Access Intercom APIs | Direct only (OAuth) |
Security
Section titled “Security”All resource credentials are:
- Encrypted at rest using AES
- Decrypted only in the Resource Gateway
- Never exposed to user code directly
Creating a Resource
Section titled “Creating a Resource”- Navigate to Resources in the Console
- Click New Resource
- Select the resource type
- Enter connection details
- Test the connection
Using Resources in Tools
Section titled “Using Resources in Tools”Resources are available in tool code via the context.resources object:
// PostgreSQLconst result = await context.resources.db.query("SELECT * FROM users WHERE id = $1", [userId])
// MySQLconst result = await context.resources.db.query("SELECT * FROM orders WHERE customer_id = ?", [customerId])
// Stripeconst customer = await context.resources.stripe.request("GET", `/v1/customers/${customerId}`)
// GitHubconst issues = await context.resources.github.request("GET", "/repos/myorg/myrepo/issues?state=open")
// Intercomconst conversations = await context.resources.intercom.request("GET", "/conversations")Connection Modes
Section titled “Connection Modes”Resources can connect in two modes:
- Direct: Resource Gateway connects directly using stored credentials
- Connector: Queries routed through a Connector running in your network (for databases in private VPCs)
Resource Gateway
Section titled “Resource Gateway”The Resource Gateway is an internal service that:
- Manages connection pools for databases
- Handles OAuth token refresh for GitHub and Intercom
- Enforces rate limits
- Logs all external access
- Provides network isolation