Skip to content
Get started

Create a source

client.promptly.sources.create(SourceCreateParams { config, name, organizationId, 6 more } body, RequestOptionsoptions?): Source { id, config, name, 14 more }
POST/api/promptly/sources

Create a new data source connection

ParametersExpand Collapse
body: SourceCreateParams { config, name, organizationId, 6 more }
config: unknown
name: string
organizationId: string
formatuuid
type: "mcp" | "api" | "local"
Accepts one of the following:
"mcp"
"api"
"local"
authConfig?: unknown
authType?: string
description?: string
iconUrl?: string
slug?: string
ReturnsExpand Collapse
Source { id, config, name, 14 more }
id: string
formatuuid
config: Config { args, baseUrl, command, 3 more }

Source-specific configuration

args?: Array<string>

Command arguments

baseUrl?: string

Base URL for API sources

formaturi
command?: string

Command to run for stdio transport

env?: Record<string, string>

Environment variables

transport?: "stdio" | "http" | "websocket"

MCP transport type

Accepts one of the following:
"stdio"
"http"
"websocket"
url?: string

URL for http/websocket transport

formaturi
name: string
type: "mcp" | "api" | "local"

Source connection type

Accepts one of the following:
"mcp"
"api"
"local"
authConfig?: AuthConfig { headerName, prefix, provider }

Authentication configuration

headerName?: string
prefix?: string
provider?: string
authType?: "none" | "oauth" | "bearer" | 5 more
Accepts one of the following:
"none"
"oauth"
"bearer"
"basic"
"header"
"query"
"api_key"
"composio"
composioConnected?: boolean

Whether Composio OAuth is completed

composioToolkit?: string

Composio toolkit name (e.g., 'todoist', 'github')

createdAt?: string
formatdate-time
description?: string
iconUrl?: string
formaturi
isActive?: boolean

Whether the source is connected and ready

lastConnectedAt?: string
formatdate-time
organizationId?: string
formatuuid
slug?: string

URL-friendly identifier

tools?: Array<Tool { description, inputSchema, name } >

Available tools from this source

description?: string
inputSchema?: unknown

JSON Schema for tool parameters

name?: string
updatedAt?: string
formatdate-time

Create a source

import _0ct from '0ct';

const client = new _0ct({
  apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted
});

const source = await client.promptly.sources.create({
  config: {},
  name: 'name',
  organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  type: 'mcp',
});

console.log(source.id);
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "config": {
    "args": [
      "string"
    ],
    "baseUrl": "https://example.com",
    "command": "command",
    "env": {
      "foo": "string"
    },
    "transport": "stdio",
    "url": "https://example.com"
  },
  "name": "name",
  "type": "mcp",
  "authConfig": {
    "headerName": "headerName",
    "prefix": "prefix",
    "provider": "provider"
  },
  "authType": "none",
  "composioConnected": true,
  "composioToolkit": "composioToolkit",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "iconUrl": "https://example.com",
  "isActive": true,
  "lastConnectedAt": "2019-12-27T18:11:19.117Z",
  "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "slug": "slug",
  "tools": [
    {
      "description": "description",
      "inputSchema": {},
      "name": "name"
    }
  ],
  "updatedAt": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "config": {
    "args": [
      "string"
    ],
    "baseUrl": "https://example.com",
    "command": "command",
    "env": {
      "foo": "string"
    },
    "transport": "stdio",
    "url": "https://example.com"
  },
  "name": "name",
  "type": "mcp",
  "authConfig": {
    "headerName": "headerName",
    "prefix": "prefix",
    "provider": "provider"
  },
  "authType": "none",
  "composioConnected": true,
  "composioToolkit": "composioToolkit",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "iconUrl": "https://example.com",
  "isActive": true,
  "lastConnectedAt": "2019-12-27T18:11:19.117Z",
  "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "slug": "slug",
  "tools": [
    {
      "description": "description",
      "inputSchema": {},
      "name": "name"
    }
  ],
  "updatedAt": "2019-12-27T18:11:19.117Z"
}