Skip to main content
Glama

cribl_getPipelineConfig

Retrieve the full configuration JSON of a Cribl pipeline by its ID, with optional worker group selection for targeted management.

Instructions

Retrieves full configuration JSON for a specified pipeline in a worker group.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupNameNoOptional: 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.
pipelineIdYesThe ID of the pipeline to retrieve configuration for.

Implementation Reference

  • src/server.ts:210-269 (registration)
    Registration of the 'cribl_getPipelineConfig' tool with the MCP server, including its description, schema, and handler.
    server.tool(
        'cribl_getPipelineConfig',
        'Retrieves full configuration JSON for a specified pipeline in a worker group.',
        GetPipelineConfigArgsShape,
        async (args: ValidatedArgs<typeof GetPipelineConfigArgsShape>) => {
            console.error(`[Tool Call] cribl_getPipelineConfig 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 { pipelineId } = args;
    
            // Input validation for pipelineId itself (prevent empty strings)
            if (!pipelineId || pipelineId.trim().length === 0) {
                // Fetch valid IDs to include in the error message
                const pipelinesListResult = await getPipelines(groupName);
                const validIdsString = pipelinesListResult.success 
                    ? `Valid pipeline IDs are: [${pipelinesListResult.data?.map(p => p.id).join(', ') || 'None found'}]`
                    : `Failed to retrieve list of valid IDs: ${pipelinesListResult.error}`;
                return {
                    isError: true,
                    content: [{ type: 'text', text: `Pipeline ID argument is required and cannot be empty. ${validIdsString}` }],
                };
            }
    
            const result = await getPipelineConfig(groupName, pipelineId);
    
            if (!result.success) {
                let errorMessage = result.error || 'Unknown error getting pipeline config.';
                // Check if it's the specific 404 Item not found error
                const isNotFoundError = errorMessage.includes('(404)') && 
                                       (errorMessage.toLowerCase().includes('item not found') || 
                                        errorMessage.toLowerCase().includes('not found'));
                                        
                if (isNotFoundError) {
                    console.error(`[stderr] Pipeline ID '${pipelineId}' not found in group '${groupName}', fetching valid IDs...`);
                    const pipelinesListResult = await getPipelines(groupName);
                    if (pipelinesListResult.success) {
                        const validIds = pipelinesListResult.data?.map(p => p.id) || [];
                        errorMessage = `Pipeline ID '${pipelineId}' not found in group '${groupName}'. Valid pipeline IDs are: [${validIds.join(', ') || 'None found'}]`;
                    } else {
                        errorMessage = `Pipeline ID '${pipelineId}' not found in group '${groupName}'. Additionally, failed to retrieve list of valid IDs: ${pipelinesListResult.error}`; 
                    }
                }
                
                console.error(`[Tool Error] cribl_getPipelineConfig (Group: ${groupName}, ID: ${pipelineId}):`, errorMessage);
                return {
                    isError: true,
                    content: [{ type: 'text', text: errorMessage }],
                };
            }
    
            console.error(`[Tool Success] cribl_getPipelineConfig for Group: ${groupName}, ID: ${pipelineId}`);
            return {
                // Return the full pipeline object which includes the config
                content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }], 
            };
        }
    );
  • Zod validation schema for the 'cribl_getPipelineConfig' tool arguments: optional groupName and required pipelineId string.
    const GetPipelineConfigArgsShape = {
        groupName: GroupNameArgSchema,
        pipelineId: z.string().describe('The ID of the pipeline to retrieve configuration for.'),
    };
  • Handler function that resolves the worker group name, validates pipelineId, calls the API client, and returns the pipeline configuration JSON.
    async (args: ValidatedArgs<typeof GetPipelineConfigArgsShape>) => {
        console.error(`[Tool Call] cribl_getPipelineConfig 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 { pipelineId } = args;
    
        // Input validation for pipelineId itself (prevent empty strings)
        if (!pipelineId || pipelineId.trim().length === 0) {
            // Fetch valid IDs to include in the error message
            const pipelinesListResult = await getPipelines(groupName);
            const validIdsString = pipelinesListResult.success 
                ? `Valid pipeline IDs are: [${pipelinesListResult.data?.map(p => p.id).join(', ') || 'None found'}]`
                : `Failed to retrieve list of valid IDs: ${pipelinesListResult.error}`;
            return {
                isError: true,
                content: [{ type: 'text', text: `Pipeline ID argument is required and cannot be empty. ${validIdsString}` }],
            };
        }
    
        const result = await getPipelineConfig(groupName, pipelineId);
    
        if (!result.success) {
            let errorMessage = result.error || 'Unknown error getting pipeline config.';
            // Check if it's the specific 404 Item not found error
            const isNotFoundError = errorMessage.includes('(404)') && 
                                   (errorMessage.toLowerCase().includes('item not found') || 
                                    errorMessage.toLowerCase().includes('not found'));
                                    
            if (isNotFoundError) {
                console.error(`[stderr] Pipeline ID '${pipelineId}' not found in group '${groupName}', fetching valid IDs...`);
                const pipelinesListResult = await getPipelines(groupName);
                if (pipelinesListResult.success) {
                    const validIds = pipelinesListResult.data?.map(p => p.id) || [];
                    errorMessage = `Pipeline ID '${pipelineId}' not found in group '${groupName}'. Valid pipeline IDs are: [${validIds.join(', ') || 'None found'}]`;
                } else {
                    errorMessage = `Pipeline ID '${pipelineId}' not found in group '${groupName}'. Additionally, failed to retrieve list of valid IDs: ${pipelinesListResult.error}`; 
                }
            }
            
            console.error(`[Tool Error] cribl_getPipelineConfig (Group: ${groupName}, ID: ${pipelineId}):`, errorMessage);
            return {
                isError: true,
                content: [{ type: 'text', text: errorMessage }],
            };
        }
    
        console.error(`[Tool Success] cribl_getPipelineConfig for Group: ${groupName}, ID: ${pipelineId}`);
        return {
            // Return the full pipeline object which includes the config
            content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }], 
        };
    }
  • API client helper that performs the GET request to `/api/v1/m/{groupName}/pipelines/{pipelineId}` and returns the pipeline configuration.
    export async function getPipelineConfig(groupName: string, pipelineId: string): Promise<ClientResult<CriblPipeline>> {
        const context = `getPipelineConfig (Group: ${groupName}, ID: ${pipelineId})`;
         if (!groupName) {
            return { success: false, error: 'Group name is required for getPipelineConfig.' }; 
        }
        if (!pipelineId) {
            return { success: false, error: 'Pipeline ID is required for getPipelineConfig.' };
        }
        // Use group-specific path
        const url = `/api/v1/m/${groupName}/pipelines/${pipelineId}`; 
        console.error(`[stderr] Attempting API call: GET ${url}`);
        try {
            // Assuming the response is the full pipeline object, including its config
            const response = await apiClient.get<CriblPipeline>(url);
            return { success: true, data: response.data };
        } catch (error) {
            const errorMessage = handleApiError(error, context);
            return { success: false, error: errorMessage };
        }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must fully disclose behavioral traits. It states the operation is a retrieval, but omits details about potential errors (e.g., missing pipeline or group), performance implications, or authorization requirements. The limited transparency leaves the agent underinformed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-formed sentence that front-loads the core action. Every word is necessary; there is no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with two parameters and no annotations or output schema, the description is minimally adequate. It states the resource and action but lacks details on return format (beyond 'JSON'), error handling, or integration with sibling tools. It does not fully preempt common agent questions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the description adds minimal value beyond the parameter descriptions. It clarifies the return format ('full configuration JSON') but does not elaborate on parameter semantics beyond what the schema already provides. Baseline at 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Retrieves') and clearly identifies the resource ('full configuration JSON for a specified pipeline in a worker group'). It distinguishes itself from siblings like 'cribl_getPipelines' by focusing on the full configuration of a single pipeline.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as 'cribl_getPipelines' for listing pipelines, or 'cribl_setPipelineConfig' for updates. No prerequisites or contextual cues are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pebbletek/cribl-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server