CloudBees Unify MCP Server API examples

3 minute read

These examples show how to use an AI agent connected to the CloudBees Unify MCP Server to discover available tools, retrieve a tool’s parameter specification, and fetch the raw JSON tool definition. For the complete list of available tools and toolsets, refer to CloudBees Unify MCP Server tool reference.

Example: List available toolsets and their tools

Use the list_toolsets tool to discover which toolsets the server exposes and which tools each toolset contains.

Example 1. Prompt
List the available toolsets.

The agent calls list_toolsets with no parameters and returns the current toolset names and their member tools.

Response
{ "toolsets": [ { "name": "default", "description": "Read-only discovery and context tools. Served automatically when no X-MCP-Toolsets header is provided.", "tools": [ "user_whoami", "organizations_list", "organizations_get", "organizations_search", "organizations_list_suborganizations", "services_list", "resources_list", "search_runs", "automation_jobs_list", "workflow_list", "logs_list", "flags_applications_list", "flags_environments_list", "flags_list", "flag_configuration_get" ] }, { "name": "feature-management", "description": "Feature flags, configurations, environments, target groups, approvals, and custom properties.", "tools": [ "flags_add", "flags_delete", "flags_update_defaultValue", "flags_configurations_list", "flags_configuration_state_update", "flag_configuration_conditions_set", "flag_serve_to_target_group", "flag_approval_requests_list", "flag_target_groups_list", "flag_target_groups_add", "flag_target_groups_delete" ] } ] }
The response includes all toolsets the server exposes. The tools your agent can actually call depend on which toolsets you requested via the X-MCP-Toolsets header and your CloudBees Unify role assignments.

Example: Get the API specification for a tool

Ask the agent to describe a specific tool’s parameters, data types, and required versus optional fields.

Example 2. Prompt
What parameters does flags_list accept? Which are required?

The agent introspects the tool definition and returns a structured description of each parameter.

Response
{ "tool": "flags_list", "description": "List feature flags in an application, or fetch a single flag directly. Provide id or name to get a single flag; omit both to list all flags. If you provide both, id takes precedence.", "parameters": [ { "name": "applicationId", "type": "string", "required": true, "description": "The ID of the application whose flags you want to list." }, { "name": "id", "type": "string", "required": false, "description": "The ID of a specific flag to retrieve. If provided, returns a single flag. Takes precedence over name if both are provided." }, { "name": "name", "type": "string", "required": false, "description": "The name of a specific flag to retrieve. Used only when id is not provided." } ] }

Example: Retrieve the raw JSON tool definition

Ask the agent for the raw JSON schema of a tool to use in automation or integration work.

Example 3. Prompt
Give me the raw JSON definition for the flags_list tool.

The agent returns the complete JSON tool definition as the MCP server exposes it.

Response
{ "name": "flags_list", "description": "List feature flags in an application, or fetch a single flag directly. Provide id or name to get a single flag; omit both to list all flags. If you provide both, id takes precedence.", "inputSchema": { "type": "object", "properties": { "applicationId": { "type": "string", "description": "The ID of the application whose flags you want to list." }, "id": { "type": "string", "description": "The ID of a specific flag to retrieve. Takes precedence over name if both are provided." }, "name": { "type": "string", "description": "The name of a specific flag to retrieve. Used only when id is not provided." } }, "required": ["applicationId"] } }