cribl_deployPipeline
Deploy a specific committed configuration version to a worker group. Returns the list of ConfigGroup objects from Cribl. Use to apply a saved configuration commit.
Instructions
Deploys a specific committed configuration version to a worker group. Returns the list of ConfigGroup objects Cribl provides.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupName | No | Optional: The name of the Worker Group/Fleet. If omitted, defaults to attempting to use Cribl Stream and if only one group exists for Stream, it will use that sole group. | |
| version | Yes | The commit ID (version) to deploy. |
Implementation Reference
- src/server.ts:475-501 (registration)Registers the 'cribl_deployPipeline' MCP tool with its schema and handler logic. Accepts optional groupName and required version, resolves the group, calls deployPipeline API, and returns the result.
server.tool( 'cribl_deployPipeline', 'Deploys a specific committed configuration version to a worker group. Returns the list of ConfigGroup objects Cribl provides.', DeployPipelineArgsShape, async (args: ValidatedArgs<typeof DeployPipelineArgsShape>) => { console.error(`[Tool Call] cribl_deployPipeline with args:`, args) // Resolve group name (optional arg) const groupResolution = await resolveGroupName(args.groupName) if (groupResolution.error || !groupResolution.groupName) { return { isError: true, content: [{ type: 'text', text: groupResolution.error || 'Could not determine group name.' }] } } const groupName = groupResolution.groupName const { version } = args const result = await deployPipeline(groupName, version) if (!result.success || !result.data) { console.error(`[Tool Error] cribl_deployPipeline:`, result.error || 'Unknown error') return { isError: true, content: [{ type: 'text', text: `Error deploying version ${version}: ${result.error}` }] } } // Success: expose full JSON result including all ConfigGroup fields console.error(`[Tool Success] cribl_deployPipeline: Deployed commit ${version} to group ${groupName}. ConfigGroups returned: ${result.data.count}`) return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] } } ) - src/server.ts:470-473 (schema)Zod schema for cribl_deployPipeline arguments: optional groupName (reusable schema) and required version string.
const DeployPipelineArgsShape = { groupName: GroupNameArgSchema, version: z.string().min(1).describe('The commit ID (version) to deploy.') }; - src/api/criblClient.ts:565-592 (handler)Core API handler that PATCHes /api/v1/master/groups/{groupName}/deploy with the given version (commit ID) and returns the DeployResponse containing ConfigGroup items.
export async function deployPipeline( groupName: string, version: string // Commit ID to deploy ): Promise<ClientResult<DeployResponse>> { const context = `deployPipeline (Group: ${groupName}, Version: ${version})`; if (!groupName) return { success: false, error: 'Group name is required for deployPipeline.' }; if (!version) return { success: false, error: 'Version (commit ID) is required for deployPipeline.' }; const url = `/api/v1/master/groups/${groupName}/deploy`; console.error(`[stderr] Attempting API call: PATCH ${url} with version: "${version}"`); try { const payload = { version }; // Use PATCH per API docs and expect DeployResponse const response = await apiClient.patch<DeployResponse>(url, payload); const data = response.data; if (data && Array.isArray(data.items) && data.items.length > 0) { console.error(`[stderr] ${context}: Deployment API returned ${data.items.length} ConfigGroup items (count=${data.count}).`); return { success: true, data }; } const msg = 'Deployment API returned empty items array.'; console.error(`[stderr] ${context}: ${msg}`); return { success: false, error: msg }; } catch (error) { const errorMessage = handleApiError(error, context); return { success: false, error: errorMessage }; } } - src/api/criblClient.ts:113-137 (schema)Type definitions for the deploy API response: DeployResponse (count + items array) and ConfigGroup interface.
interface ConfigGroup { id: string; name?: string; description?: string; configVersion?: string; workerCount?: number; isFleet?: boolean; isSearch?: boolean; deployingWorkerCount?: number; incompatibleWorkerCount?: number; tags?: string; streamtags?: string[]; git?: { commit?: string; localChanges?: number; log?: any[]; }; // Allow extra fields from API we haven't modelled yet [key: string]: any; } interface DeployResponse { count: number; items: ConfigGroup[]; } - src/server.ts:41-46 (helper)Reusable Zod schema for the optional groupName argument, used by cribl_deployPipeline (and other tools).
const GroupNameArgSchema = z.preprocess( (val) => (val === null ? undefined : val), // Map null to undefined before validation z.string().optional() // Then validate as optional string ).describe( "Optional: The name of the Worker Group/Fleet. If omitted, defaults to attempting to use Cribl Stream and if only one group exists for Stream, it will use that sole group." );