@gohcltech/bitbucket-mcp
Version:
Bitbucket integration for Claude via Model Context Protocol
90 lines • 3.01 kB
TypeScript
/**
* @fileoverview Consolidated commit management tool for v2.1.
*
* Replaces v2.0 tools: list_commits, get_commit, get_commit_diff, get_commit_patch
* Consolidates 4 tools into 1 with action-based routing.
*/
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { ConsolidatedBaseTool } from './consolidated-base-tool.js';
import { ToolHandler } from './base-tool.js';
import { ToolCategory } from '../auth-capabilities.js';
import { CommitAction } from '../types/consolidated-tools.js';
/**
* Consolidated commit management tool for v2.1.
*
* Provides unified commit query and analysis operations with action-based routing.
*
* **Replaces v2.0 tools:**
* - list_commits
* - get_commit
* - get_commit_diff
* - get_commit_patch
*
* **Actions:**
* - `list`: List commits in a repository with optional filtering
* - `get`: Get detailed information about a specific commit
* - `get_diff`: Get the diff showing changes introduced by a commit
* - `get_patch`: Generate a Git-compatible patch for a commit
*
* @example
* ```typescript
* // List commits on a branch
* const response = await tool.execute({
* action: 'list',
* workspaceSlug: 'my-workspace',
* repoSlug: 'my-repo',
* branch: 'develop'
* });
*
* // Get specific commit details
* const response = await tool.execute({
* action: 'get',
* workspaceSlug: 'my-workspace',
* repoSlug: 'my-repo',
* commitHash: 'abc123def456abc123def456abc123def456abc1'
* });
*
* // Get commit diff
* const response = await tool.execute({
* action: 'get_diff',
* workspaceSlug: 'my-workspace',
* repoSlug: 'my-repo',
* commitHash: 'abc123def456abc123def456abc123def456abc1'
* });
* ```
*/
export declare class QueryCommitsTool extends ConsolidatedBaseTool<CommitAction> {
getTools(): Tool[];
getToolCategory(): ToolCategory;
protected getActionHandler(action: CommitAction): ToolHandler | null;
protected validateActionParams(action: CommitAction, args: Record<string, any>): void;
/**
* Handler for listing commits in a repository.
*
* @param args - Tool arguments (workspace, repo, optional branch filters)
* @returns List of commits with metadata
*/
private handleListCommits;
/**
* Handler for getting detailed information about a specific commit.
*
* @param args - Tool arguments (must include commitHash)
* @returns Detailed commit information
*/
private handleGetCommit;
/**
* Handler for getting the diff of a specific commit.
*
* @param args - Tool arguments (must include commitHash, optional path and context)
* @returns Commit diff with file changes
*/
private handleGetCommitDiff;
/**
* Handler for generating a Git patch for a specific commit.
*
* @param args - Tool arguments (must include commitHash)
* @returns Git-compatible patch format string
*/
private handleGetCommitPatch;
}
//# sourceMappingURL=commit-tools.d.ts.map