Skip to content

Resources

Resources represent external systems that tools can interact with.

Synatra supports five resource types:

Resource TypeDescriptionConnection Mode
PostgreSQLConnect to PostgreSQL databasesDirect or Connector
MySQLConnect to MySQL databasesDirect or Connector
StripeAccess Stripe payment APIsDirect only
GitHubAccess GitHub repository APIsDirect only (OAuth)
IntercomAccess Intercom APIsDirect only (OAuth)

All resource credentials are:

  • Encrypted at rest using AES
  • Decrypted only in the Resource Gateway
  • Never exposed to user code directly
  1. Navigate to Resources in the Console
  2. Click New Resource
  3. Select the resource type
  4. Enter connection details
  5. Test the connection

Resources are available in tool code via the context.resources object:

// PostgreSQL
const result = await context.resources.db.query("SELECT * FROM users WHERE id = $1", [userId])
// MySQL
const result = await context.resources.db.query("SELECT * FROM orders WHERE customer_id = ?", [customerId])
// Stripe
const customer = await context.resources.stripe.request("GET", `/v1/customers/${customerId}`)
// GitHub
const issues = await context.resources.github.request("GET", "/repos/myorg/myrepo/issues?state=open")
// Intercom
const conversations = await context.resources.intercom.request("GET", "/conversations")

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)

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