cribl_versionControl
Check if version control (git) is enabled on your Cribl instance and verify if a remote repository URL is configured. Identify configuration status for version tracking.
Instructions
Detects if version control (git) is enabled on the Cribl instance and whether a remote repository URL is configured.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:370-413 (handler)The main handler for the 'cribl_versionControl' tool. It calls versionControl() from the API client, extracts key details (enabled, remote URL, branch, last commit, status), logs them, and returns the full version info as JSON.
server.tool( 'cribl_versionControl', 'Detects if version control (git) is enabled on the Cribl instance and whether a remote repository URL is configured.', VersionControlArgsShape, async () => { console.error(`[Tool Call] cribl_versionControl`) const result = await versionControl() if (!result.success || !result.data) { console.error(`[Tool Error] cribl_versionControl:`, result.error) return { isError: true, content: [{ type: 'text', text: `Error detecting version control: ${result.error}` }] } } // Extract key information from the result const versionInfo = result.data; const isEnabled = versionInfo.versioning === true; const remoteUrl = versionInfo.remote || 'None configured'; const branch = versionInfo.branch || 'unknown'; // Log detailed version control status console.error(`[Tool Success] cribl_versionControl: enabled=${isEnabled}, remoteUrl=${remoteUrl}, branch=${branch}`); // Log additional git details if available if (versionInfo.lastCommit) { console.error(`[Tool Success] cribl_versionControl: lastCommit=${versionInfo.lastCommit.id}, message="${versionInfo.lastCommit.message}", author=${versionInfo.lastCommit.author}`); } if (versionInfo.status) { const hasChanges = ( (versionInfo.status.staged && versionInfo.status.staged.length > 0) || (versionInfo.status.unstaged && versionInfo.status.unstaged.length > 0) || (versionInfo.status.untracked && versionInfo.status.untracked.length > 0) ); console.error(`[Tool Success] cribl_versionControl: hasChanges=${hasChanges}, staged=${versionInfo.status.staged?.length || 0}, unstaged=${versionInfo.status.unstaged?.length || 0}, untracked=${versionInfo.status.untracked?.length || 0}`); } // Return full details for LLM use return { content: [{ type: 'text', text: JSON.stringify(versionInfo, null, 2) }] } } - src/api/criblClient.ts:492-516 (helper)The API client function that performs the actual HTTP GET request to /api/v1/version/info to retrieve version control details from the Cribl instance.
export async function versionControl(): Promise<ClientResult<VersionControlItem>> { const context = 'versionControl'; const url = '/api/v1/version/info'; console.error(`[stderr] Attempting API call: GET ${url}`); try { // API returns items array with version control status details const response = await apiClient.get<{ items: VersionControlItem[], count: number }>(url); if (response.data?.items && Array.isArray(response.data.items) && response.data.items.length > 0) { // Return complete information from the first item const versionInfo = response.data.items[0]; console.error(`[stderr] ${context}: Version control enabled=${versionInfo.versioning}, remote=${versionInfo.remote || 'none'}, branch=${versionInfo.branch || 'unknown'}`); return { success: true, data: versionInfo }; } else { console.error(`[stderr] ${context}: Unexpected response structure or empty items array:`, response.data); return { success: false, error: 'Unexpected response structure from version/info endpoint.' }; } } catch (error) { const errorMessage = handleApiError(error, context); return { success: false, error: errorMessage }; } } - src/api/criblClient.ts:57-73 (schema)VersionControlItem interface defining the response shape including versioning flag, remote URL, branch, status (staged/unstaged/untracked), and lastCommit info.
interface VersionControlItem { versioning: boolean; // Whether version control is enabled remote: string; // Remote repository URL, if configured branch?: string; // Current branch name status?: { // Git status information staged: any[]; // Staged files information unstaged: any[]; // Unstaged changes untracked: any[]; // Untracked files }; lastCommit?: { // Information about the last commit id: string; // Commit hash date: string; // Commit date message: string; // Commit message author: string; // Author of the commit }; [key: string]: any; // Allow other properties } - src/server.ts:371-371 (registration)Registration of the tool via server.tool() with the name 'cribl_versionControl', description, and empty args schema.
'cribl_versionControl', - src/server.ts:368-368 (schema)Empty Zod args shape for cribl_versionControl since no input parameters are required.
const VersionControlArgsShape = {}