Connector
Use Alibaba Cloud Model Studio CLI to discover connector tools, inspect their inputs, and run them on an authorized connector instance.
Call authorized Connector tools in a workspace from the CLI to query enterprise system data, read SaaS application content, or run authorized operations.
ImportantAppend --help to any command for full parameter details, for example bl connector tools --help. Command details on this page are verified against bl 2.15.0.
Connect apps and authorize accounts in the console. For concepts and authorization, see Connector.
Prerequisites
- An API Key that belongs to the target workspace. For authentication, see Installation and authentication.
- For
bl connector schemaandbl connector call, at least one app connected and its account authorized in the console.bl connector toolscan find matching tools before authorization and reports the authorization status. - Connector commands use a workspace-specific endpoint. Provide the workspace ID with
--workspace-id <id>, theBAILIAN_WORKSPACE_IDenvironment variable, or theworkspace_idconfiguration item.
Workflow
- Describe the task to find matching tools and authorized instances.
- Inspect the input schema of the selected tool.
- Pass a JSON object that matches the schema to run the tool.
1. Find tools and instances
bl connector tools --query "Find tomorrow's meetings"
--querydescribes the task and can name a preferred app or account.- Use the tool reference (
toolRef), instance ID (recommendedInstanceIdor an ID frominstances), andtraceIdfrom the result in the following commands. - A task can return multiple tools or instances. Pick the one that matches the task.
2. Inspect the tool input schema
bl connector schema --tool <toolRef> --instance <instanceId> --trace-id <traceId> --output json
--tool: the tool reference returned bybl connector tools.--instance: the ID of the authorized connector instance.--trace-id: optional. Reuse the trace ID from discovery to keep the call chain together.- Build the
--jsonobject for the next step from the returned schema.
3. Run the tool
bl connector call --tool <toolRef> --instance <instanceId> --json '{"key":"value"}' --trace-id <traceId> --dry-run
--jsonmust be a JSON object that matches the tool input schema.--dry-runonly previews the request and does not validate the arguments against the tool schema. Remove it to validate and run the tool.- Running a tool reads or writes data in the authorized system. Verify the tool, instance, and arguments first.
Command reference
All commands accept --workspace-id <id> or the BAILIAN_WORKSPACE_ID environment variable. The tables below omit shared parameters such as --api-key, --output, and --dry-run.
bl connector tools
Discover connector tools and authorized instances by intent. Requires API Key authentication.
Usage
bl connector tools --query <text> [flags]
| Parameter | Type | Required | Description |
|---|---|---|---|
--query <text> | string | yes | Describe the task and any preferred app or account |
Example
bl connector tools --query "Find tomorrow's meetings"
- Returns matching tools and authorized instances in the workspace. When
instancesis empty andauthorizationRequiredis true, authorize the app in the console first. - Use the tool reference (
toolRef), instance ID (recommendedInstanceIdor an ID frominstances), andtraceIdfrom the result inschemaandcall.
bl connector schema
Inspect the input schema of a connector tool for the selected instance. Requires API Key authentication.
Usage
bl connector schema --tool <toolRef> --instance <instanceId> [flags]
| Parameter | Type | Required | Description |
|---|---|---|---|
--tool <toolRef> | string | yes | Tool reference returned by discovery |
--instance <instanceId> | string | yes | Selected authorized connector instance |
--trace-id <id> | string | no | Trace ID from connector discovery |
Example: Inspect the input schema as JSON
bl connector schema --tool <toolRef> --instance <instanceId> --output json
bl connector call
Validate arguments and run one connector tool on the selected instance. Requires API Key authentication.
Usage
bl connector call --tool <toolRef> --instance <instanceId> --json '<object>' [flags]
| Parameter | Type | Required | Description |
|---|---|---|---|
--tool <toolRef> | string | yes | Tool reference returned by discovery |
--instance <instanceId> | string | yes | Selected authorized connector instance |
--json <object> | string | yes | JSON object matching the selected tool schema |
--trace-id <id> | string | no | Trace ID from connector discovery |
Example: Preview the request without running the tool
bl connector call --tool <toolRef> --instance <instanceId> --json '{}' --dry-run
--dry-runonly previews the request and does not validate the arguments against the tool schema.- Without
--dry-run, invalid arguments fail before the execution request is sent. - Running a tool reads or writes data in the authorized system.
- Use
--output jsonfor structured results that scripts or agents can parse.