@debugg-ai/debugg-ai-mcp
Version:
Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.
43 lines (41 loc) • 2.46 kB
JavaScript
import { ProjectInputSchema } from '../types/index.js';
import { projectHandler } from '../handlers/projectHandler.js';
import { WRITES } from './annotations.js';
const DESCRIPTION = `Manage DebuggAI projects. Pass an "action":
- "get" {uuid} → one project with full detail.
- "list" {q?, page?, pageSize?} → paginated project summaries.
- "create" {name, platform, (teamUuid|teamName), (repoUuid|repoName)} → create a project. The repo must be GitHub-linked; names resolve by case-insensitive exact match.
Note: there is no update/delete here — rename/delete a project from the DebuggAI web app.`;
export function buildProjectTool() {
return {
name: 'project',
title: 'Project',
annotations: WRITES,
description: DESCRIPTION,
inputSchema: {
type: 'object',
properties: {
action: { type: 'string', enum: ['get', 'list', 'create'], description: 'Operation to perform.' },
uuid: { type: 'string', description: '[get] Project UUID.' },
q: { type: 'string', description: '[list] Free-text search.' },
page: { type: 'number', description: '[list] Page (1-indexed).' },
pageSize: { type: 'number', description: '[list] Page size (1..200).' },
name: { type: 'string', description: '[create] Project name.' },
platform: { type: 'string', description: '[create] Platform, e.g. "web".' },
teamUuid: { type: 'string', description: '[create] Team UUID (or teamName).' },
teamName: { type: 'string', description: '[create] Team name (or teamUuid).' },
repoUuid: { type: 'string', description: '[create] GitHub repo UUID (or repoName).' },
repoName: { type: 'string', description: '[create] GitHub repo name "org/repo" (or repoUuid).' },
},
required: ['action'],
// No top-level oneOf/anyOf/allOf: the Anthropic tool input_schema rejects
// them and clients (Claude Code) silently drop the tool. Per-action required
// fields are enforced by the Zod discriminated union in types/index.ts and
// documented in DESCRIPTION above.
additionalProperties: false,
},
};
}
export function buildValidatedProjectTool() {
return { ...buildProjectTool(), inputSchema: ProjectInputSchema, handler: projectHandler };
}