cribl_getPipelines
Retrieves pipeline definitions from a specified worker group, enabling configuration management and inspection of Cribl data processing logic.
Instructions
Fetches pipeline definitions in a specified worker group.
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. |
Implementation Reference
- src/server.ts:140-143 (schema)Zod schema for cribl_getPipelines arguments - defines optional groupName parameter using GroupNameArgSchema.
// Define schema for getPipelines arguments (groupName optional) const GetPipelinesArgsShape = { groupName: GroupNameArgSchema, }; - src/server.ts:145-170 (handler)MCP tool handler for 'cribl_getPipelines' - resolves the group name, calls the getPipelines API client function, and returns the pipeline definitions as JSON.
server.tool( 'cribl_getPipelines', 'Fetches pipeline definitions in a specified worker group.', GetPipelinesArgsShape, async (args: ValidatedArgs<typeof GetPipelinesArgsShape>) => { console.error(`[Tool Call] cribl_getPipelines with args:`, args); const groupResolution = await resolveGroupName(args.groupName); // Pass directly, preprocess handles null if (groupResolution.error || !groupResolution.groupName) { return { isError: true, content: [{ type: 'text', text: groupResolution.error || 'Could not determine group name.' }] }; } const groupName = groupResolution.groupName; const result = await getPipelines(groupName); if (!result.success) { console.error(`[Tool Error] cribl_getPipelines (Group: ${groupName}):`, result.error); return { isError: true, content: [{ type: 'text', text: `Error fetching pipelines for group ${groupName}: ${result.error}` }], }; } console.error(`[Tool Success] cribl_getPipelines (Group: ${groupName}): Found ${result.data?.length || 0} pipelines.`); return { content: [{ type: 'text', text: JSON.stringify(result.data || [], null, 2) }], }; } ); - src/server.ts:145-146 (registration)Registration of the 'cribl_getPipelines' tool via server.tool(), binding the name, description, schema, and handler.
server.tool( 'cribl_getPipelines', - src/api/criblClient.ts:335-350 (helper)The getPipelines API client function that performs the actual HTTP GET request to /api/v1/m/{groupName}/pipelines and returns the pipeline items array.
export async function getPipelines(groupName: string): Promise<ClientResult<CriblPipeline[]>> { const context = `getPipelines (Group: ${groupName})`; if (!groupName) { return { success: false, error: 'Group name is required for getPipelines.' }; } // Use group-specific path const url = `/api/v1/m/${groupName}/pipelines`; console.error(`[stderr] Attempting API call: GET ${url}`); try { const response = await apiClient.get<CriblApiResponse>(url); return { success: true, data: response.data.items as CriblPipeline[] }; } catch (error) { const errorMessage = handleApiError(error, context); return { success: false, error: errorMessage }; } }