Skip to main content
Glama

cribl_getSources

Retrieve source configurations for a specified worker group or fleet in Cribl Stream, defaulting to the sole group if only one exists.

Instructions

Fetches source configurations in a specified 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.

Implementation Reference

  • src/server.ts:177-202 (registration)
    The MCP tool 'cribl_getSources' is registered using server.tool() with a schema (GetSourcesArgsShape) that accepts an optional groupName. The handler resolves the group name, calls getSources(), and returns the result as JSON.
    server.tool(
        'cribl_getSources',
        'Fetches source configurations in a specified worker group.',
        GetSourcesArgsShape,
        async (args: ValidatedArgs<typeof GetSourcesArgsShape>) => { 
            console.error(`[Tool Call] cribl_getSources 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 getSources(groupName);
            if (!result.success) {
                console.error(`[Tool Error] cribl_getSources (Group: ${groupName}):`, result.error);
                return {
                    isError: true,
                    content: [{ type: 'text', text: `Error fetching sources for group ${groupName}: ${result.error}` }],
                };
            }
            console.error(`[Tool Success] cribl_getSources (Group: ${groupName}): Found ${result.data?.length || 0} sources.`);
            return {
                content: [{ type: 'text', text: JSON.stringify(result.data || [], null, 2) }],
            };
        }
    );
  • The input schema for 'cribl_getSources' — GetSourcesArgsShape — defines an optional 'groupName' argument using GroupNameArgSchema (preprocesses null to undefined and validates as optional string).
    const GetSourcesArgsShape = {
        groupName: GroupNameArgSchema,
    };
  • The actual API client function getSources() that performs the HTTP GET request to /api/v1/m/{groupName}/system/inputs to fetch source configurations from Cribl. It handles validation, API errors, and returns a ClientResult<CriblSource[]>.
    export async function getSources(groupName: string): Promise<ClientResult<CriblSource[]>> {
        const context = `getSources (Group: ${groupName})`;
        if (!groupName) {
            // This check might be redundant if called correctly, but good safety
            return { success: false, error: 'Group name is required for getSources.' };
        }
        // Use group-specific path
        const url = `/api/v1/m/${groupName}/system/inputs`;
        console.error(`[stderr] Attempting API call: GET ${url}`);
        try {
            const response = await apiClient.get<CriblApiResponse>(url);
            // Assuming the response structure still has an 'items' array for inputs
            return { success: true, data: response.data.items as CriblSource[] };
        } catch (error) {
            const errorMessage = handleApiError(error, context);
            return { success: false, error: errorMessage };
        }
    }
Behavior3/5

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

No annotations are provided, so the description must convey behavioral traits. 'Fetches' implies a read-only operation with no side effects, but this is not explicitly stated. The description does disclose the default behavior when groupName is omitted, adding some transparency.

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 extremely concise: two sentences covering purpose and parameter behavior without any fluff. Every word is necessary.

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?

The tool has low complexity (one optional parameter, no nested objects, no output schema), but the description does not mention the return format or error cases. It provides enough context for basic usage but omits details about what 'source configurations' entails.

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

Parameters4/5

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

The schema covers the parameter at 100%, but the description adds value beyond the schema's description by explaining the default behavior when groupName is omitted, including the fallback logic for Cribl Stream groups.

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 clearly states the action ('Fetches'), the resource ('source configurations'), and the scope ('in a specified worker group'). It distinguishes itself from sibling tools like cribl_getPipelines or cribl_setPipelineConfig, which deal with pipelines.

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

Usage Guidelines3/5

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

The description does not explicitly state when to use this tool versus alternatives. However, the context of fetching source configurations is clear, and the optional parameter's default behavior is explained, which helps the agent decide if a worker group is needed.

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