Files
session-mcp/src/tools/index.ts
Christian Gick 2c7a2de5b3 feat(task-mcp): Add task_resolve_duplicate tool
Combines close + link operations for duplicate issues:
- Closes the duplicate task (sets status to completed)
- Creates bidirectional 'duplicates' link to dominant task

Usage: task_resolve_duplicate(duplicate_id, dominant_id)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 06:34:16 +02:00

201 lines
6.6 KiB
TypeScript

// Tool definitions for task-mcp
export const toolDefinitions = [
// CRUD Tools
{
name: 'task_add',
description: 'Create a new task with auto-generated ID and semantic embedding',
inputSchema: {
type: 'object',
properties: {
title: { type: 'string', description: 'Task title (required)' },
project: { type: 'string', description: 'Project key (e.g., ST, VPN). Auto-detected from CWD if not provided.' },
type: { type: 'string', enum: ['task', 'bug', 'feature', 'debt'], description: 'Task type (default: task)' },
priority: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'], description: 'Priority level (default: P2)' },
description: { type: 'string', description: 'Optional description' },
},
required: ['title'],
},
},
{
name: 'task_list',
description: 'List tasks with optional filters',
inputSchema: {
type: 'object',
properties: {
project: { type: 'string', description: 'Filter by project key' },
status: { type: 'string', enum: ['open', 'in_progress', 'testing', 'blocked', 'completed'], description: 'Filter by status' },
type: { type: 'string', enum: ['task', 'bug', 'feature', 'debt'], description: 'Filter by type' },
priority: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'], description: 'Filter by priority' },
limit: { type: 'number', description: 'Max results (default: 20)' },
},
},
},
{
name: 'task_show',
description: 'Show task details including checklist and dependencies',
inputSchema: {
type: 'object',
properties: {
id: { type: 'string', description: 'Task ID (e.g., ST-1, VPN-45)' },
},
required: ['id'],
},
},
{
name: 'task_close',
description: 'Mark a task as completed',
inputSchema: {
type: 'object',
properties: {
id: { type: 'string', description: 'Task ID to close' },
},
required: ['id'],
},
},
{
name: 'task_update',
description: 'Update task fields (status, priority, type, title)',
inputSchema: {
type: 'object',
properties: {
id: { type: 'string', description: 'Task ID to update' },
status: { type: 'string', enum: ['open', 'in_progress', 'testing', 'blocked', 'completed'], description: 'New status' },
priority: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'], description: 'New priority' },
type: { type: 'string', enum: ['task', 'bug', 'feature', 'debt'], description: 'New type' },
title: { type: 'string', description: 'New title' },
},
required: ['id'],
},
},
// Semantic Search Tools
{
name: 'task_similar',
description: 'Find semantically similar tasks using pgvector',
inputSchema: {
type: 'object',
properties: {
query: { type: 'string', description: 'Search query' },
project: { type: 'string', description: 'Filter by project (optional)' },
limit: { type: 'number', description: 'Max results (default: 5)' },
},
required: ['query'],
},
},
{
name: 'task_context',
description: 'Get related tasks for current work context (useful for delegations)',
inputSchema: {
type: 'object',
properties: {
description: { type: 'string', description: 'Description of current work' },
project: { type: 'string', description: 'Current project' },
limit: { type: 'number', description: 'Max related tasks (default: 3)' },
},
required: ['description'],
},
},
// Relation Tools
{
name: 'task_link',
description: 'Create dependency between tasks',
inputSchema: {
type: 'object',
properties: {
from_id: { type: 'string', description: 'Source task ID' },
to_id: { type: 'string', description: 'Target task ID' },
link_type: { type: 'string', enum: ['blocks', 'relates_to', 'duplicates'], description: 'Relationship type' },
},
required: ['from_id', 'to_id', 'link_type'],
},
},
{
name: 'task_checklist_add',
description: 'Add a checklist item to a task',
inputSchema: {
type: 'object',
properties: {
task_id: { type: 'string', description: 'Task ID' },
item: { type: 'string', description: 'Checklist item text' },
},
required: ['task_id', 'item'],
},
},
{
name: 'task_checklist_toggle',
description: 'Toggle a checklist item (check/uncheck)',
inputSchema: {
type: 'object',
properties: {
item_id: { type: 'number', description: 'Checklist item ID' },
checked: { type: 'boolean', description: 'New checked state' },
},
required: ['item_id', 'checked'],
},
},
{
name: 'task_resolve_duplicate',
description: 'Resolve a duplicate issue by closing it and linking to the dominant issue',
inputSchema: {
type: 'object',
properties: {
duplicate_id: { type: 'string', description: 'The duplicate task ID to close' },
dominant_id: { type: 'string', description: 'The dominant/original task ID to keep' },
},
required: ['duplicate_id', 'dominant_id'],
},
},
// Epic Tools
{
name: 'epic_add',
description: 'Create a new epic (session-scoped work bundle) with auto-generated ID',
inputSchema: {
type: 'object',
properties: {
title: { type: 'string', description: 'Epic title (required)' },
project: { type: 'string', description: 'Project key (e.g., VPN, ST). Auto-detected if not provided.' },
description: { type: 'string', description: 'Optional description of the epic scope' },
},
required: ['title'],
},
},
{
name: 'epic_list',
description: 'List epics with task counts and progress',
inputSchema: {
type: 'object',
properties: {
project: { type: 'string', description: 'Filter by project key' },
status: { type: 'string', enum: ['open', 'in_progress', 'completed'], description: 'Filter by status' },
limit: { type: 'number', description: 'Max results (default: 20)' },
},
},
},
{
name: 'epic_show',
description: 'Show epic details with all assigned tasks',
inputSchema: {
type: 'object',
properties: {
id: { type: 'string', description: 'Epic ID (e.g., VPN-E1, ST-E3)' },
},
required: ['id'],
},
},
{
name: 'epic_assign',
description: 'Assign a task to an epic',
inputSchema: {
type: 'object',
properties: {
task_id: { type: 'string', description: 'Task ID to assign' },
epic_id: { type: 'string', description: 'Epic ID to assign to' },
},
required: ['task_id', 'epic_id'],
},
},
];