@codervisor/devlog-mcp
Version:
MCP server for managing development logs and working notes
292 lines • 12.5 kB
TypeScript
/**
* MCP Tool validation schemas
*
* This module defines Zod schemas for validating MCP tool arguments.
* It reuses business logic schemas from @codervisor/devlog-core and adds
* MCP-specific validation layers.
*/
import { z } from 'zod';
/**
* Devlog tool argument schemas
*/
export declare const CreateDevlogArgsSchema: z.ZodEffects<z.ZodObject<{
title: z.ZodString;
type: z.ZodEnum<["feature", "bugfix", "task", "refactor", "docs"]>;
description: z.ZodString;
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
businessContext: z.ZodOptional<z.ZodString>;
technicalContext: z.ZodOptional<z.ZodString>;
acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
type: "feature" | "bugfix" | "task" | "refactor" | "docs";
title: string;
description: string;
priority?: "low" | "medium" | "high" | "critical" | undefined;
businessContext?: string | undefined;
technicalContext?: string | undefined;
acceptanceCriteria?: string[] | undefined;
}, {
type: "feature" | "bugfix" | "task" | "refactor" | "docs";
title: string;
description: string;
priority?: "low" | "medium" | "high" | "critical" | undefined;
businessContext?: string | undefined;
technicalContext?: string | undefined;
acceptanceCriteria?: string[] | undefined;
}>, {
priority: "low" | "medium" | "high" | "critical";
type: "feature" | "bugfix" | "task" | "refactor" | "docs";
title: string;
description: string;
businessContext?: string | undefined;
technicalContext?: string | undefined;
acceptanceCriteria?: string[] | undefined;
}, {
type: "feature" | "bugfix" | "task" | "refactor" | "docs";
title: string;
description: string;
priority?: "low" | "medium" | "high" | "critical" | undefined;
businessContext?: string | undefined;
technicalContext?: string | undefined;
acceptanceCriteria?: string[] | undefined;
}>;
export declare const UpdateDevlogArgsSchema: z.ZodObject<{
id: z.ZodNumber;
status: z.ZodOptional<z.ZodEnum<["new", "in-progress", "blocked", "in-review", "testing", "done", "cancelled"]>>;
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
businessContext: z.ZodOptional<z.ZodString>;
technicalContext: z.ZodOptional<z.ZodString>;
acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
id: number;
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
businessContext?: string | undefined;
technicalContext?: string | undefined;
acceptanceCriteria?: string[] | undefined;
}, {
id: number;
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
businessContext?: string | undefined;
technicalContext?: string | undefined;
acceptanceCriteria?: string[] | undefined;
}>;
export declare const GetDevlogArgsSchema: z.ZodObject<{
id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: number;
}, {
id: number;
}>;
export declare const ListDevlogsArgsSchema: z.ZodObject<{
status: z.ZodOptional<z.ZodEnum<["new", "in-progress", "blocked", "in-review", "testing", "done", "cancelled"]>>;
type: z.ZodOptional<z.ZodEnum<["feature", "bugfix", "task", "refactor", "docs"]>>;
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
archived: z.ZodOptional<z.ZodBoolean>;
page: z.ZodOptional<z.ZodNumber>;
limit: z.ZodOptional<z.ZodNumber>;
sortBy: z.ZodOptional<z.ZodEnum<["createdAt", "updatedAt", "priority", "status", "title"]>>;
sortOrder: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
}, "strip", z.ZodTypeAny, {
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
type?: "feature" | "bugfix" | "task" | "refactor" | "docs" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
archived?: boolean | undefined;
page?: number | undefined;
limit?: number | undefined;
sortBy?: "status" | "priority" | "createdAt" | "updatedAt" | "title" | undefined;
sortOrder?: "asc" | "desc" | undefined;
}, {
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
type?: "feature" | "bugfix" | "task" | "refactor" | "docs" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
archived?: boolean | undefined;
page?: number | undefined;
limit?: number | undefined;
sortBy?: "status" | "priority" | "createdAt" | "updatedAt" | "title" | undefined;
sortOrder?: "asc" | "desc" | undefined;
}>;
export declare const SearchDevlogsArgsSchema: z.ZodObject<{
query: z.ZodString;
status: z.ZodOptional<z.ZodEnum<["new", "in-progress", "blocked", "in-review", "testing", "done", "cancelled"]>>;
type: z.ZodOptional<z.ZodEnum<["feature", "bugfix", "task", "refactor", "docs"]>>;
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
archived: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
query: string;
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
type?: "feature" | "bugfix" | "task" | "refactor" | "docs" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
archived?: boolean | undefined;
}, {
query: string;
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
type?: "feature" | "bugfix" | "task" | "refactor" | "docs" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
archived?: boolean | undefined;
}>;
export declare const AddDevlogNoteArgsSchema: z.ZodEffects<z.ZodObject<{
id: z.ZodNumber;
note: z.ZodString;
category: z.ZodOptional<z.ZodEnum<["progress", "issue", "solution", "idea", "reminder", "feedback"]>>;
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
codeChanges: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id: number;
note: string;
category?: "progress" | "issue" | "solution" | "idea" | "reminder" | "feedback" | undefined;
files?: string[] | undefined;
codeChanges?: string | undefined;
}, {
id: number;
note: string;
category?: "progress" | "issue" | "solution" | "idea" | "reminder" | "feedback" | undefined;
files?: string[] | undefined;
codeChanges?: string | undefined;
}>, {
category: "progress" | "issue" | "solution" | "idea" | "reminder" | "feedback";
id: number;
note: string;
files?: string[] | undefined;
codeChanges?: string | undefined;
}, {
id: number;
note: string;
category?: "progress" | "issue" | "solution" | "idea" | "reminder" | "feedback" | undefined;
files?: string[] | undefined;
codeChanges?: string | undefined;
}>;
export declare const UpdateDevlogWithNoteArgsSchema: z.ZodEffects<z.ZodObject<{
id: z.ZodNumber;
status: z.ZodOptional<z.ZodEnum<["new", "in-progress", "blocked", "in-review", "testing", "done", "cancelled"]>>;
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
note: z.ZodString;
category: z.ZodOptional<z.ZodEnum<["progress", "issue", "solution", "idea", "reminder", "feedback"]>>;
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
codeChanges: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id: number;
note: string;
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
category?: "progress" | "issue" | "solution" | "idea" | "reminder" | "feedback" | undefined;
files?: string[] | undefined;
codeChanges?: string | undefined;
}, {
id: number;
note: string;
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
category?: "progress" | "issue" | "solution" | "idea" | "reminder" | "feedback" | undefined;
files?: string[] | undefined;
codeChanges?: string | undefined;
}>, {
category: "progress" | "issue" | "solution" | "idea" | "reminder" | "feedback";
id: number;
note: string;
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
files?: string[] | undefined;
codeChanges?: string | undefined;
}, {
id: number;
note: string;
status?: "new" | "in-progress" | "blocked" | "in-review" | "testing" | "done" | "cancelled" | undefined;
priority?: "low" | "medium" | "high" | "critical" | undefined;
category?: "progress" | "issue" | "solution" | "idea" | "reminder" | "feedback" | undefined;
files?: string[] | undefined;
codeChanges?: string | undefined;
}>;
export declare const CompleteDevlogArgsSchema: z.ZodObject<{
id: z.ZodNumber;
summary: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id: number;
summary?: string | undefined;
}, {
id: number;
summary?: string | undefined;
}>;
export declare const CloseDevlogArgsSchema: z.ZodObject<{
id: z.ZodNumber;
reason: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id: number;
reason?: string | undefined;
}, {
id: number;
reason?: string | undefined;
}>;
export declare const ArchiveDevlogArgsSchema: z.ZodObject<{
id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: number;
}, {
id: number;
}>;
export declare const DiscoverRelatedDevlogsArgsSchema: z.ZodObject<{
workDescription: z.ZodString;
workType: z.ZodEnum<["feature", "bugfix", "task", "refactor", "docs"]>;
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
workDescription: string;
workType: "feature" | "bugfix" | "task" | "refactor" | "docs";
keywords?: string[] | undefined;
scope?: string | undefined;
}, {
workDescription: string;
workType: "feature" | "bugfix" | "task" | "refactor" | "docs";
keywords?: string[] | undefined;
scope?: string | undefined;
}>;
/**
* Project tool argument schemas
*/
export declare const ListProjectsArgsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
export declare const GetCurrentProjectArgsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
export declare const SwitchProjectArgsSchema: z.ZodObject<{
projectId: z.ZodString;
}, "strip", z.ZodTypeAny, {
projectId: string;
}, {
projectId: string;
}>;
/**
* Type exports for tool argument validation
*/
export type CreateDevlogArgs = z.infer<typeof CreateDevlogArgsSchema>;
export type UpdateDevlogArgs = z.infer<typeof UpdateDevlogArgsSchema>;
export type GetDevlogArgs = z.infer<typeof GetDevlogArgsSchema>;
export type ListDevlogsArgs = z.infer<typeof ListDevlogsArgsSchema>;
export type SearchDevlogsArgs = z.infer<typeof SearchDevlogsArgsSchema>;
export type AddDevlogNoteArgs = z.infer<typeof AddDevlogNoteArgsSchema>;
export type UpdateDevlogWithNoteArgs = z.infer<typeof UpdateDevlogWithNoteArgsSchema>;
export type CompleteDevlogArgs = z.infer<typeof CompleteDevlogArgsSchema>;
export type CloseDevlogArgs = z.infer<typeof CloseDevlogArgsSchema>;
export type ArchiveDevlogArgs = z.infer<typeof ArchiveDevlogArgsSchema>;
export type DiscoverRelatedDevlogsArgs = z.infer<typeof DiscoverRelatedDevlogsArgsSchema>;
export type ListProjectsArgs = z.infer<typeof ListProjectsArgsSchema>;
export type GetCurrentProjectArgs = z.infer<typeof GetCurrentProjectArgsSchema>;
export type SwitchProjectArgs = z.infer<typeof SwitchProjectArgsSchema>;
/**
* Validation helper functions
*/
export declare class McpToolValidator {
/**
* Validate tool arguments against schema
*/
static validate<T>(schema: z.ZodSchema<T>, data: unknown): {
success: true;
data: T;
} | {
success: false;
errors: string[];
};
/**
* Validate and throw on error
*/
static validateOrThrow<T>(schema: z.ZodSchema<T>, data: unknown): T;
}
//# sourceMappingURL=mcp-tool-schemas.d.ts.map