fix: adjust mcp to always use absolute path in description (#143)

This commit is contained in:
Ralph Khreish
2025-04-09 20:52:29 +02:00
committed by GitHub
parent cfe3ba91e8
commit b78535ac19
20 changed files with 37 additions and 25 deletions

View File

@@ -27,7 +27,9 @@ export function registerAddDependencyTool(server) {
file: z
.string()
.optional()
.describe('Path to the tasks file (default: tasks/tasks.json)'),
.describe(
'Absolute path to the tasks file (default: tasks/tasks.json)'
),
projectRoot: z
.string()
.optional()

View File

@@ -48,7 +48,9 @@ export function registerAddSubtaskTool(server) {
file: z
.string()
.optional()
.describe('Path to the tasks file (default: tasks/tasks.json)'),
.describe(
'Absolute path to the tasks file (default: tasks/tasks.json)'
),
skipGenerate: z
.boolean()
.optional()

View File

@@ -31,7 +31,7 @@ export function registerAddTaskTool(server) {
.string()
.optional()
.describe('Task priority (high, medium, low)'),
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -42,7 +42,9 @@ export function registerAnalyzeTool(server) {
file: z
.string()
.optional()
.describe('Path to the tasks file (default: tasks/tasks.json)'),
.describe(
'Absolute path to the tasks file (default: tasks/tasks.json)'
),
research: z
.boolean()
.optional()

View File

@@ -29,7 +29,9 @@ export function registerClearSubtasksTool(server) {
file: z
.string()
.optional()
.describe('Path to the tasks file (default: tasks/tasks.json)'),
.describe(
'Absolute path to the tasks file (default: tasks/tasks.json)'
),
projectRoot: z
.string()
.optional()

View File

@@ -43,7 +43,9 @@ export function registerExpandAllTool(server) {
file: z
.string()
.optional()
.describe('Path to the tasks file (default: tasks/tasks.json)'),
.describe(
'Absolute path to the tasks file (default: tasks/tasks.json)'
),
projectRoot: z
.string()
.optional()

View File

@@ -35,7 +35,7 @@ export function registerExpandTaskTool(server) {
.string()
.optional()
.describe('Additional context for subtask generation'),
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()
@@ -43,7 +43,7 @@ export function registerExpandTaskTool(server) {
'Root directory of the project (default: current working directory)'
)
}),
execute: async (args, { log, reportProgress, session }) => {
execute: async (args, { log, session }) => {
try {
log.info(`Starting expand-task with args: ${JSON.stringify(args)}`);

View File

@@ -20,7 +20,7 @@ export function registerFixDependenciesTool(server) {
name: 'fix_dependencies',
description: 'Fix invalid dependencies in tasks automatically',
parameters: z.object({
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -21,7 +21,7 @@ export function registerGenerateTool(server) {
description:
'Generates individual task files in tasks/ directory based on tasks.json',
parameters: z.object({
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
output: z
.string()
.optional()

View File

@@ -39,7 +39,7 @@ export function registerShowTaskTool(server) {
description: 'Get detailed information about a specific task',
parameters: z.object({
id: z.string().describe('Task ID to get'),
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -21,7 +21,7 @@ export function registerNextTaskTool(server) {
description:
'Find the next task to work on based on dependencies and status',
parameters: z.object({
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -24,9 +24,7 @@ export function registerParsePRDTool(server) {
input: z
.string()
.default('tasks/tasks.json')
.describe(
'Path to the PRD document file (relative to project root or absolute)'
),
.describe('Absolute path to the PRD document file'),
numTasks: z
.string()
.optional()
@@ -37,7 +35,7 @@ export function registerParsePRDTool(server) {
.string()
.optional()
.describe(
'Output path for tasks.json file (relative to project root or absolute, default: tasks/tasks.json)'
'Output absolute path for tasks.json file (default: tasks/tasks.json)'
),
force: z
.boolean()
@@ -47,7 +45,7 @@ export function registerParsePRDTool(server) {
.string()
.optional()
.describe(
'Root directory of the project (default: automatically detected from session or CWD)'
'Absolute path to the root directory of the project (default: automatically detected from session or CWD)'
)
}),
execute: async (args, { log, session }) => {

View File

@@ -25,7 +25,9 @@ export function registerRemoveDependencyTool(server) {
file: z
.string()
.optional()
.describe('Path to the tasks file (default: tasks/tasks.json)'),
.describe(
'Absolute path to the tasks file (default: tasks/tasks.json)'
),
projectRoot: z
.string()
.optional()

View File

@@ -34,7 +34,9 @@ export function registerRemoveSubtaskTool(server) {
file: z
.string()
.optional()
.describe('Path to the tasks file (default: tasks/tasks.json)'),
.describe(
'Absolute path to the tasks file (default: tasks/tasks.json)'
),
skipGenerate: z
.boolean()
.optional()

View File

@@ -23,7 +23,7 @@ export function registerRemoveTaskTool(server) {
id: z
.string()
.describe("ID of the task or subtask to remove (e.g., '5' or '5.2')"),
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -30,7 +30,7 @@ export function registerSetTaskStatusTool(server) {
.describe(
"New status to set (e.g., 'pending', 'done', 'in-progress', 'review', 'deferred', 'cancelled'."
),
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -31,7 +31,7 @@ export function registerUpdateSubtaskTool(server) {
.boolean()
.optional()
.describe('Use Perplexity AI for research-backed updates'),
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -31,7 +31,7 @@ export function registerUpdateTaskTool(server) {
.boolean()
.optional()
.describe('Use Perplexity AI for research-backed updates'),
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -33,7 +33,7 @@ export function registerUpdateTool(server) {
.boolean()
.optional()
.describe('Use Perplexity AI for research-backed updates'),
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()

View File

@@ -21,7 +21,7 @@ export function registerValidateDependenciesTool(server) {
description:
'Check tasks for dependency issues (like circular references or links to non-existent tasks) without making changes.',
parameters: z.object({
file: z.string().optional().describe('Path to the tasks file'),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()
.optional()