Files
ColaFlow/colaflow-api/src/Modules/Mcp/ColaFlow.Modules.Mcp.Contracts/Tools/McpToolInputSchema.cs
Yaojia Wang 61e0f1249c fix(backend): Fix MCP module compilation errors by using correct exception classes
Replaced non-existent ColaFlow.Shared.Kernel.Exceptions namespace references
with ColaFlow.Modules.Mcp.Domain.Exceptions in 5 files:

Changes:
- McpToolRegistry.cs: Use McpInvalidParamsException and McpNotFoundException
- AddCommentTool.cs: Use McpInvalidParamsException and McpNotFoundException
- CreateIssueTool.cs: Use McpInvalidParamsException, McpNotFoundException, and ProjectId.From()
- UpdateStatusTool.cs: Use McpNotFoundException
- ToolParameterParser.cs: Use McpInvalidParamsException for all validation errors

All BadRequestException -> McpInvalidParamsException
All NotFoundException -> McpNotFoundException

Also fixed CreateIssueTool to convert Guid to ProjectId value object.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:31:17 +01:00

90 lines
2.3 KiB
C#

namespace ColaFlow.Modules.Mcp.Contracts.Tools;
/// <summary>
/// JSON Schema for tool input parameters
/// </summary>
public sealed class McpToolInputSchema
{
/// <summary>
/// Schema type (always "object" for tool inputs)
/// </summary>
public string Type { get; set; } = "object";
/// <summary>
/// Schema properties (parameter definitions)
/// Key is parameter name, value is parameter schema
/// </summary>
public Dictionary<string, JsonSchemaProperty> Properties { get; set; } = new();
/// <summary>
/// List of required parameter names
/// </summary>
public List<string> Required { get; set; } = new();
}
/// <summary>
/// JSON Schema property definition
/// </summary>
public sealed class JsonSchemaProperty
{
/// <summary>
/// Property type: "string", "number", "integer", "boolean", "array", "object"
/// </summary>
public string Type { get; set; } = "string";
/// <summary>
/// Property description (for AI to understand)
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Enum values (for restricted choices)
/// </summary>
public string[]? Enum { get; set; }
/// <summary>
/// String format hint: "uuid", "email", "date-time", "uri", etc.
/// </summary>
public string? Format { get; set; }
/// <summary>
/// Minimum value (for numbers)
/// </summary>
public decimal? Minimum { get; set; }
/// <summary>
/// Maximum value (for numbers)
/// </summary>
public decimal? Maximum { get; set; }
/// <summary>
/// Minimum length (for strings)
/// </summary>
public int? MinLength { get; set; }
/// <summary>
/// Maximum length (for strings)
/// </summary>
public int? MaxLength { get; set; }
/// <summary>
/// Pattern (regex) for string validation
/// </summary>
public string? Pattern { get; set; }
/// <summary>
/// Items schema (for arrays)
/// </summary>
public JsonSchemaProperty? Items { get; set; }
/// <summary>
/// Properties schema (for nested objects)
/// </summary>
public Dictionary<string, JsonSchemaProperty>? Properties { get; set; }
/// <summary>
/// Default value
/// </summary>
public object? Default { get; set; }
}