diff --git a/pkg/server/api/mcp/v1/schema.resolvers.go b/pkg/server/api/mcp/v1/schema.resolvers.go index 1533f3c62..7eadcbc24 100644 --- a/pkg/server/api/mcp/v1/schema.resolvers.go +++ b/pkg/server/api/mcp/v1/schema.resolvers.go @@ -1266,3 +1266,114 @@ func (r *Resolver) UnlinkControlSnapshotTool(ctx context.Context, req *mcp.CallT return nil, types.UnlinkControlSnapshotOutput{}, nil } + +func (r *Resolver) ListTasksTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListTasksInput) (*mcp.CallToolResult, types.ListTasksOutput, error) { + r.MustBeAuthorized(ctx, input.OrganizationID, authz.ActionListTasks) + + prb := r.ProboService(ctx, input.OrganizationID) + + pageOrderBy := page.OrderBy[coredata.TaskOrderField]{ + Field: coredata.TaskOrderFieldCreatedAt, + Direction: page.OrderDirectionDesc, + } + if input.OrderBy != nil { + pageOrderBy = page.OrderBy[coredata.TaskOrderField]{ + Field: input.OrderBy.Field, + Direction: input.OrderBy.Direction, + } + } + + cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy) + + page, err := prb.Tasks.ListForOrganizationID(ctx, input.OrganizationID, cursor) + if err != nil { + panic(fmt.Errorf("cannot list organization tasks: %w", err)) + } + + return nil, types.NewListTasksOutput(page), nil +} + +func (r *Resolver) GetTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetTaskInput) (*mcp.CallToolResult, types.GetTaskOutput, error) { + r.MustBeAuthorized(ctx, input.ID, authz.ActionGet) + + prb := r.ProboService(ctx, input.ID) + + task, err := prb.Tasks.Get(ctx, input.ID) + if err != nil { + return nil, types.GetTaskOutput{}, fmt.Errorf("failed to get task: %w", err) + } + return nil, types.GetTaskOutput{ + Task: types.NewTask(task), + }, nil +} + +func (r *Resolver) AddTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddTaskInput) (*mcp.CallToolResult, types.AddTaskOutput, error) { + r.MustBeAuthorized(ctx, input.OrganizationID, authz.ActionCreateTask) + + svc := r.ProboService(ctx, input.OrganizationID) + + task, err := svc.Tasks.Create(ctx, probo.CreateTaskRequest{ + OrganizationID: input.OrganizationID, + Name: input.Name, + Description: input.Description, + TimeEstimate: input.TimeEstimate, + Deadline: input.Deadline, + AssignedToID: input.AssignedToID, + }) + if err != nil { + return nil, types.AddTaskOutput{}, fmt.Errorf("failed to create task: %w", err) + } + return nil, types.AddTaskOutput{ + Task: types.NewTask(task), + }, nil +} + +func (r *Resolver) UpdateTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateTaskInput) (*mcp.CallToolResult, types.UpdateTaskOutput, error) { + r.MustBeAuthorized(ctx, input.ID, authz.ActionUpdateTask) + + svc := r.ProboService(ctx, input.ID) + + task, err := svc.Tasks.Update(ctx, probo.UpdateTaskRequest{ + TaskID: input.ID, + Name: input.Name, + Description: UnwrapOmittable(input.Description), + State: input.State, + TimeEstimate: UnwrapOmittable(input.TimeEstimate), + Deadline: UnwrapOmittable(input.Deadline), + }) + if err != nil { + return nil, types.UpdateTaskOutput{}, fmt.Errorf("failed to update task: %w", err) + } + return nil, types.UpdateTaskOutput{ + Task: types.NewTask(task), + }, nil +} + +func (r *Resolver) AssignTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AssignTaskInput) (*mcp.CallToolResult, types.AssignTaskOutput, error) { + r.MustBeAuthorized(ctx, input.ID, authz.ActionAssignTask) + + svc := r.ProboService(ctx, input.ID) + + task, err := svc.Tasks.Assign(ctx, input.ID, input.AssignedToID) + if err != nil { + return nil, types.AssignTaskOutput{}, fmt.Errorf("failed to assign task: %w", err) + } + + return nil, types.AssignTaskOutput{ + Task: types.NewTask(task), + }, nil +} + +func (r *Resolver) UnassignTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UnassignTaskInput) (*mcp.CallToolResult, types.UnassignTaskOutput, error) { + r.MustBeAuthorized(ctx, input.ID, authz.ActionUnassignTask) + + svc := r.ProboService(ctx, input.ID) + + task, err := svc.Tasks.Unassign(ctx, input.ID) + if err != nil { + return nil, types.UnassignTaskOutput{}, fmt.Errorf("failed to unassign task: %w", err) + } + return nil, types.UnassignTaskOutput{ + Task: types.NewTask(task), + }, nil +} diff --git a/pkg/server/api/mcp/v1/server/server.go b/pkg/server/api/mcp/v1/server/server.go index d192fe8df..f6c995b8e 100644 --- a/pkg/server/api/mcp/v1/server/server.go +++ b/pkg/server/api/mcp/v1/server/server.go @@ -65,6 +65,12 @@ type ResolverInterface interface { UnlinkControlAuditTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UnlinkControlAuditInput) (*mcp.CallToolResult, types.UnlinkControlAuditOutput, error) LinkControlSnapshotTool(ctx context.Context, req *mcp.CallToolRequest, input *types.LinkControlSnapshotInput) (*mcp.CallToolResult, types.LinkControlSnapshotOutput, error) UnlinkControlSnapshotTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UnlinkControlSnapshotInput) (*mcp.CallToolResult, types.UnlinkControlSnapshotOutput, error) + ListTasksTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListTasksInput) (*mcp.CallToolResult, types.ListTasksOutput, error) + GetTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetTaskInput) (*mcp.CallToolResult, types.GetTaskOutput, error) + AddTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddTaskInput) (*mcp.CallToolResult, types.AddTaskOutput, error) + UpdateTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateTaskInput) (*mcp.CallToolResult, types.UpdateTaskOutput, error) + AssignTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AssignTaskInput) (*mcp.CallToolResult, types.AssignTaskOutput, error) + UnassignTaskTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UnassignTaskInput) (*mcp.CallToolResult, types.UnassignTaskOutput, error) } // New creates a new MCP server instance with all handlers registered. @@ -634,4 +640,64 @@ func registerToolHandlers(server *mcp.Server, resolver ResolverInterface) { }, resolver.UnlinkControlSnapshotTool, ) + mcp.AddTool( + server, + &mcp.Tool{ + Name: "listTasks", + Description: "List all tasks for the organization or measure", + InputSchema: types.ListTasksToolInputSchema, + OutputSchema: types.ListTasksToolOutputSchema, + }, + resolver.ListTasksTool, + ) + mcp.AddTool( + server, + &mcp.Tool{ + Name: "getTask", + Description: "Get a task by ID", + InputSchema: types.GetTaskToolInputSchema, + OutputSchema: types.GetTaskToolOutputSchema, + }, + resolver.GetTaskTool, + ) + mcp.AddTool( + server, + &mcp.Tool{ + Name: "addTask", + Description: "Add a new task to the organization", + InputSchema: types.AddTaskToolInputSchema, + OutputSchema: types.AddTaskToolOutputSchema, + }, + resolver.AddTaskTool, + ) + mcp.AddTool( + server, + &mcp.Tool{ + Name: "updateTask", + Description: "Update an existing task", + InputSchema: types.UpdateTaskToolInputSchema, + OutputSchema: types.UpdateTaskToolOutputSchema, + }, + resolver.UpdateTaskTool, + ) + mcp.AddTool( + server, + &mcp.Tool{ + Name: "assignTask", + Description: "Assign a task to a person", + InputSchema: types.AssignTaskToolInputSchema, + OutputSchema: types.AssignTaskToolOutputSchema, + }, + resolver.AssignTaskTool, + ) + mcp.AddTool( + server, + &mcp.Tool{ + Name: "unassignTask", + Description: "Unassign a task from a person", + InputSchema: types.UnassignTaskToolInputSchema, + OutputSchema: types.UnassignTaskToolOutputSchema, + }, + resolver.UnassignTaskTool, + ) } diff --git a/pkg/server/api/mcp/v1/specification.yaml b/pkg/server/api/mcp/v1/specification.yaml index 653815efc..660a19a83 100644 --- a/pkg/server/api/mcp/v1/specification.yaml +++ b/pkg/server/api/mcp/v1/specification.yaml @@ -5,6 +5,11 @@ info: components: schemas: + Duration: + type: string + description: A duration + go.probo.inc/mcpgen/type: time.Duration + OrderDirection: type: string enum: @@ -2782,6 +2787,282 @@ components: UnlinkControlSnapshotOutput: type: object + TaskState: + type: string + enum: + - TODO + - DONE + go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.TaskState + + TaskOrderField: + type: string + enum: + - CREATED_AT + go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.TaskOrderField + + TaskOrderBy: + type: object + required: + - field + - direction + properties: + field: + $ref: "#/components/schemas/TaskOrderField" + description: Task order field + direction: + $ref: "#/components/schemas/OrderDirection" + description: Task order direction + + Task: + type: object + required: + - id + - organization_id + - name + - state + - created_at + - updated_at + properties: + id: + $ref: "#/components/schemas/GID" + description: Task ID + organization_id: + $ref: "#/components/schemas/GID" + description: Organization ID + measure_id: + anyOf: + - $ref: "#/components/schemas/GID" + description: Measure ID + - type: "null" + description: No measure + description: Measure ID + name: + type: string + description: Task name + description: + anyOf: + - type: string + description: Task description + - type: "null" + description: No description + description: Task description + state: + $ref: "#/components/schemas/TaskState" + description: Task state + time_estimate: + anyOf: + - $ref: "#/components/schemas/Duration" + - type: "null" + description: No time estimate + description: Time estimate + deadline: + anyOf: + - type: string + format: date-time + description: Deadline + - type: "null" + description: No deadline + description: Deadline + assigned_to_id: + anyOf: + - $ref: "#/components/schemas/GID" + description: Assigned to person ID + - type: "null" + description: Not assigned + description: Assigned to person ID + created_at: + type: string + format: date-time + description: Creation timestamp + updated_at: + type: string + format: date-time + description: Update timestamp + + ListTasksInput: + type: object + required: + - organization_id + properties: + organization_id: + $ref: "#/components/schemas/GID" + description: Organization ID + measure_id: + $ref: "#/components/schemas/GID" + description: Measure ID + order_by: + $ref: "#/components/schemas/TaskOrderBy" + description: Task order by + size: + type: integer + description: Page size + cursor: + $ref: "#/components/schemas/CursorKey" + description: Page cursor + + ListTasksOutput: + type: object + required: + - tasks + properties: + tasks: + type: array + items: + $ref: "#/components/schemas/Task" + description: List of tasks + next_cursor: + anyOf: + - $ref: "#/components/schemas/CursorKey" + - type: "null" + description: Next page cursor + + GetTaskInput: + type: object + required: + - id + properties: + id: + $ref: "#/components/schemas/GID" + description: Task ID + + GetTaskOutput: + type: object + required: + - task + properties: + task: + $ref: "#/components/schemas/Task" + + AddTaskInput: + type: object + required: + - organization_id + - name + properties: + organization_id: + $ref: "#/components/schemas/GID" + description: Organization ID + measure_id: + anyOf: + - $ref: "#/components/schemas/GID" + description: Measure ID + - type: "null" + description: No measure + description: Measure ID + name: + type: string + description: Task name + description: + type: string + description: Task description + time_estimate: + $ref: "#/components/schemas/Duration" + description: Time estimate + deadline: + type: string + format: date-time + description: Deadline + assigned_to_id: + anyOf: + - $ref: "#/components/schemas/GID" + description: Assigned to person ID + - type: "null" + description: Not assigned + description: Assigned to person ID + + AddTaskOutput: + type: object + required: + - task + properties: + task: + $ref: "#/components/schemas/Task" + + UpdateTaskInput: + type: object + required: + - id + properties: + id: + $ref: "#/components/schemas/GID" + description: Task ID + name: + type: string + description: Task name + description: + type: ["string", "null"] + description: Task description + go.probo.inc/mcpgen/omittable: true + state: + anyOf: + - $ref: "#/components/schemas/TaskState" + description: Task state + - type: "null" + description: No state + description: Task state + time_estimate: + anyOf: + - $ref: "#/components/schemas/Duration" + - type: "null" + description: No time estimate + description: Time estimate + go.probo.inc/mcpgen/omittable: true + deadline: + anyOf: + - type: string + format: date-time + description: Deadline + - type: "null" + description: No deadline + description: Deadline + go.probo.inc/mcpgen/omittable: true + + UpdateTaskOutput: + type: object + required: + - task + properties: + task: + $ref: "#/components/schemas/Task" + + AssignTaskInput: + type: object + required: + - id + - assigned_to_id + properties: + id: + $ref: "#/components/schemas/GID" + description: Task ID + assigned_to_id: + $ref: "#/components/schemas/GID" + description: Assigned to person ID + + AssignTaskOutput: + type: object + required: + - task + properties: + task: + $ref: "#/components/schemas/Task" + + UnassignTaskInput: + type: object + required: + - id + properties: + id: + $ref: "#/components/schemas/GID" + description: Task ID + + UnassignTaskOutput: + type: object + required: + - task + properties: + task: + $ref: "#/components/schemas/Task" + tools: - name: listOrganizations description: List all organizations the user has access to @@ -3168,3 +3449,45 @@ tools: $ref: "#/components/schemas/UnlinkControlSnapshotInput" outputSchema: $ref: "#/components/schemas/UnlinkControlSnapshotOutput" + - name: listTasks + description: List all tasks for the organization or measure + readonly: true + inputSchema: + $ref: "#/components/schemas/ListTasksInput" + outputSchema: + $ref: "#/components/schemas/ListTasksOutput" + - name: getTask + description: Get a task by ID + readonly: true + inputSchema: + $ref: "#/components/schemas/GetTaskInput" + outputSchema: + $ref: "#/components/schemas/GetTaskOutput" + - name: addTask + description: Add a new task to the organization + readonly: false + inputSchema: + $ref: "#/components/schemas/AddTaskInput" + outputSchema: + $ref: "#/components/schemas/AddTaskOutput" + - name: updateTask + description: Update an existing task + readonly: false + inputSchema: + $ref: "#/components/schemas/UpdateTaskInput" + outputSchema: + $ref: "#/components/schemas/UpdateTaskOutput" + - name: assignTask + description: Assign a task to a person + readonly: false + inputSchema: + $ref: "#/components/schemas/AssignTaskInput" + outputSchema: + $ref: "#/components/schemas/AssignTaskOutput" + - name: unassignTask + description: Unassign a task from a person + readonly: false + inputSchema: + $ref: "#/components/schemas/UnassignTaskInput" + outputSchema: + $ref: "#/components/schemas/UnassignTaskOutput" diff --git a/pkg/server/api/mcp/v1/types/task.go b/pkg/server/api/mcp/v1/types/task.go new file mode 100644 index 000000000..9fcde9af5 --- /dev/null +++ b/pkg/server/api/mcp/v1/types/task.go @@ -0,0 +1,51 @@ +// Copyright (c) 2025 Probo Inc . +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +package types + +import ( + "go.probo.inc/probo/pkg/coredata" + "go.probo.inc/probo/pkg/page" +) + +func NewTask(t *coredata.Task) *Task { + return &Task{ + ID: t.ID, + Name: t.Name, + Description: t.Description, + State: t.State, + TimeEstimate: t.TimeEstimate, + CreatedAt: t.CreatedAt, + UpdatedAt: t.UpdatedAt, + Deadline: t.Deadline, + } +} + +func NewListTasksOutput(taskPage *page.Page[*coredata.Task, coredata.TaskOrderField]) ListTasksOutput { + tasks := make([]*Task, 0, len(taskPage.Data)) + for _, v := range taskPage.Data { + tasks = append(tasks, NewTask(v)) + } + + var nextCursor *page.CursorKey + if len(taskPage.Data) > 0 { + cursorKey := taskPage.Data[len(taskPage.Data)-1].CursorKey(taskPage.Cursor.OrderBy.Field) + nextCursor = &cursorKey + } + + return ListTasksOutput{ + NextCursor: nextCursor, + Tasks: tasks, + } +} diff --git a/pkg/server/api/mcp/v1/types/types.go b/pkg/server/api/mcp/v1/types/types.go index 60107f787..4468f4ad7 100644 --- a/pkg/server/api/mcp/v1/types/types.go +++ b/pkg/server/api/mcp/v1/types/types.go @@ -34,8 +34,12 @@ var ( AddPeopleToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["people"],"properties":{"people":{"type":"object","required":["id","organization_id","full_name","primary_email_address","additional_email_addresses","kind","created_at","updated_at"],"properties":{"additional_email_addresses":{"type":"array","description":"Additional email addresses","items":{"type":"string"}},"contract_end_date":{"description":"Contract end date","format":"date-time"},"contract_start_date":{"description":"Contract start date","format":"date-time"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"full_name":{"type":"string","description":"Full name"},"id":{"type":"string","format":"string"},"kind":{"type":"string","enum":["EMPLOYEE","CONTRACTOR","SERVICE_ACCOUNT"]},"organization_id":{"type":"string","format":"string"},"position":{"description":"Position"},"primary_email_address":{"type":"string","description":"Primary email address"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) AddRiskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id","name","category","treatment","inherent_likelihood","inherent_impact"],"properties":{"category":{"type":"string","description":"Risk category"},"description":{"type":"string","description":"Risk description"},"inherent_impact":{"type":"integer","description":"Inherent impact"},"inherent_likelihood":{"type":"integer","description":"Inherent likelihood"},"name":{"type":"string","description":"Risk name"},"note":{"type":"string","description":"Risk note"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"residual_impact":{"type":"integer","description":"Residual impact"},"residual_likelihood":{"type":"integer","description":"Residual likelihood"},"treatment":{"type":"string","enum":["MITIGATED","ACCEPTED","AVOIDED","TRANSFERRED"]}}}`) AddRiskToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["risk"],"properties":{"risk":{"type":"object","required":["id","organization_id","name","category","treatment","inherent_likelihood","inherent_impact","inherent_risk_score","residual_likelihood","residual_impact","residual_risk_score","note","created_at","updated_at"],"properties":{"category":{"type":"string","description":"Risk category"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Risk description"},"id":{"type":"string","format":"string"},"inherent_impact":{"type":"integer","description":"Inherent impact"},"inherent_likelihood":{"type":"integer","description":"Inherent likelihood"},"inherent_risk_score":{"type":"integer","description":"Inherent risk score"},"name":{"type":"string","description":"Risk name"},"note":{"type":"string","description":"Risk note"},"organization_id":{"type":"string","format":"string"},"owner_id":{"anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No owner"}]},"residual_impact":{"type":"integer","description":"Residual impact"},"residual_likelihood":{"type":"integer","description":"Residual likelihood"},"residual_risk_score":{"type":"integer","description":"Residual risk score"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"treatment":{"type":"string","enum":["MITIGATED","ACCEPTED","AVOIDED","TRANSFERRED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) + AddTaskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id","name"],"properties":{"assigned_to_id":{"description":"Assigned to person ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"Not assigned"}]},"deadline":{"type":"string","description":"Deadline","format":"date-time"},"description":{"type":"string","description":"Task description"},"measure_id":{"description":"Measure ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No measure"}]},"name":{"type":"string","description":"Task name"},"organization_id":{"type":"string","format":"string"},"time_estimate":{"type":"string","description":"A duration"}}}`) + AddTaskToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["task"],"properties":{"task":{"type":"object","required":["id","organization_id","name","state","created_at","updated_at"],"properties":{"assigned_to_id":{"description":"Assigned to person ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"Not assigned"}]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"deadline":{"description":"Deadline","anyOf":[{"type":"string","description":"Deadline","format":"date-time"},{"type":"null","description":"No deadline"}]},"description":{"description":"Task description","anyOf":[{"type":"string","description":"Task description"},{"type":"null","description":"No description"}]},"id":{"type":"string","format":"string"},"measure_id":{"description":"Measure ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No measure"}]},"name":{"type":"string","description":"Task name"},"organization_id":{"type":"string","format":"string"},"state":{"type":"string","enum":["TODO","DONE"]},"time_estimate":{"description":"Time estimate","anyOf":[{"type":"string","description":"A duration"},{"type":"null","description":"No time estimate"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) AddVendorToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id","name"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"type":"string","description":"Vendor description"},"name":{"type":"string","description":"Vendor name"},"organization_id":{"type":"string","format":"string"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}`) AddVendorToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["vendor"],"properties":{"vendor":{"type":"object","required":["id","name","organization_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Vendor description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Vendor name"},"organization_id":{"type":"string","format":"string"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) + AssignTaskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id","assigned_to_id"],"properties":{"assigned_to_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"}}}`) + AssignTaskToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["task"],"properties":{"task":{"type":"object","required":["id","organization_id","name","state","created_at","updated_at"],"properties":{"assigned_to_id":{"description":"Assigned to person ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"Not assigned"}]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"deadline":{"description":"Deadline","anyOf":[{"type":"string","description":"Deadline","format":"date-time"},{"type":"null","description":"No deadline"}]},"description":{"description":"Task description","anyOf":[{"type":"string","description":"Task description"},{"type":"null","description":"No description"}]},"id":{"type":"string","format":"string"},"measure_id":{"description":"Measure ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No measure"}]},"name":{"type":"string","description":"Task name"},"organization_id":{"type":"string","format":"string"},"state":{"type":"string","enum":["TODO","DONE"]},"time_estimate":{"description":"Time estimate","anyOf":[{"type":"string","description":"A duration"},{"type":"null","description":"No time estimate"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) GetAssetToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`) GetAssetToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["asset"],"properties":{"asset":{"type":"object","required":["id","organization_id","name","amount","owner_id","asset_type","data_types_stored","created_at","updated_at"],"properties":{"amount":{"type":"integer","description":"Asset amount"},"asset_type":{"type":"string","enum":["PHYSICAL","VIRTUAL"]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"data_types_stored":{"type":"string","description":"Data types stored"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Asset name"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"snapshot_id":{"description":"Snapshot ID"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) GetAuditToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`) @@ -58,6 +62,8 @@ var ( GetPeopleToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["people"],"properties":{"people":{"type":"object","required":["id","organization_id","full_name","primary_email_address","additional_email_addresses","kind","created_at","updated_at"],"properties":{"additional_email_addresses":{"type":"array","description":"Additional email addresses","items":{"type":"string"}},"contract_end_date":{"description":"Contract end date","format":"date-time"},"contract_start_date":{"description":"Contract start date","format":"date-time"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"full_name":{"type":"string","description":"Full name"},"id":{"type":"string","format":"string"},"kind":{"type":"string","enum":["EMPLOYEE","CONTRACTOR","SERVICE_ACCOUNT"]},"organization_id":{"type":"string","format":"string"},"position":{"description":"Position"},"primary_email_address":{"type":"string","description":"Primary email address"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) GetRiskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`) GetRiskToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["risk"],"properties":{"risk":{"type":"object","required":["id","organization_id","name","category","treatment","inherent_likelihood","inherent_impact","inherent_risk_score","residual_likelihood","residual_impact","residual_risk_score","note","created_at","updated_at"],"properties":{"category":{"type":"string","description":"Risk category"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Risk description"},"id":{"type":"string","format":"string"},"inherent_impact":{"type":"integer","description":"Inherent impact"},"inherent_likelihood":{"type":"integer","description":"Inherent likelihood"},"inherent_risk_score":{"type":"integer","description":"Inherent risk score"},"name":{"type":"string","description":"Risk name"},"note":{"type":"string","description":"Risk note"},"organization_id":{"type":"string","format":"string"},"owner_id":{"anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No owner"}]},"residual_impact":{"type":"integer","description":"Residual impact"},"residual_likelihood":{"type":"integer","description":"Residual likelihood"},"residual_risk_score":{"type":"integer","description":"Residual risk score"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"treatment":{"type":"string","enum":["MITIGATED","ACCEPTED","AVOIDED","TRANSFERRED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) + GetTaskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`) + GetTaskToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["task"],"properties":{"task":{"type":"object","required":["id","organization_id","name","state","created_at","updated_at"],"properties":{"assigned_to_id":{"description":"Assigned to person ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"Not assigned"}]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"deadline":{"description":"Deadline","anyOf":[{"type":"string","description":"Deadline","format":"date-time"},{"type":"null","description":"No deadline"}]},"description":{"description":"Task description","anyOf":[{"type":"string","description":"Task description"},{"type":"null","description":"No description"}]},"id":{"type":"string","format":"string"},"measure_id":{"description":"Measure ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No measure"}]},"name":{"type":"string","description":"Task name"},"organization_id":{"type":"string","format":"string"},"state":{"type":"string","enum":["TODO","DONE"]},"time_estimate":{"description":"Time estimate","anyOf":[{"type":"string","description":"A duration"},{"type":"null","description":"No time estimate"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) LinkControlAuditToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["control_id","audit_id"],"properties":{"audit_id":{"type":"string","format":"string"},"control_id":{"type":"string","format":"string"}}}`) LinkControlAuditToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object"}`) LinkControlDocumentToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["control_id","document_id"],"properties":{"control_id":{"type":"string","format":"string"},"document_id":{"type":"string","format":"string"}}}`) @@ -90,8 +96,12 @@ var ( ListPeopleToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["people"],"properties":{"next_cursor":{"type":"string","format":"string"},"people":{"type":"array","items":{"type":"object","required":["id","organization_id","full_name","primary_email_address","additional_email_addresses","kind","created_at","updated_at"],"properties":{"additional_email_addresses":{"type":"array","description":"Additional email addresses","items":{"type":"string"}},"contract_end_date":{"description":"Contract end date","format":"date-time"},"contract_start_date":{"description":"Contract start date","format":"date-time"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"full_name":{"type":"string","description":"Full name"},"id":{"type":"string","format":"string"},"kind":{"type":"string","enum":["EMPLOYEE","CONTRACTOR","SERVICE_ACCOUNT"]},"organization_id":{"type":"string","format":"string"},"position":{"description":"Position"},"primary_email_address":{"type":"string","description":"Primary email address"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}}`) ListRisksToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id"],"properties":{"cursor":{"type":"string","format":"string"},"filter":{"type":"object","properties":{"query":{"type":"string","description":"Search query"},"snapshot_id":{"type":"string","format":"string"}}},"order_by":{"type":"object","required":["field","direction"],"properties":{"direction":{"type":"string","enum":["ASC","DESC"]},"field":{"type":"string","enum":["CREATED_AT","UPDATED_AT","NAME","CATEGORY","TREATMENT","INHERENT_RISK_SCORE","RESIDUAL_RISK_SCORE","OWNER_FULL_NAME"]}}},"organization_id":{"type":"string","format":"string"},"size":{"type":"integer","description":"Page size"}}}`) ListRisksToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["risks"],"properties":{"next_cursor":{"type":"string","format":"string"},"risks":{"type":"array","items":{"type":"object","required":["id","organization_id","name","category","treatment","inherent_likelihood","inherent_impact","inherent_risk_score","residual_likelihood","residual_impact","residual_risk_score","note","created_at","updated_at"],"properties":{"category":{"type":"string","description":"Risk category"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Risk description"},"id":{"type":"string","format":"string"},"inherent_impact":{"type":"integer","description":"Inherent impact"},"inherent_likelihood":{"type":"integer","description":"Inherent likelihood"},"inherent_risk_score":{"type":"integer","description":"Inherent risk score"},"name":{"type":"string","description":"Risk name"},"note":{"type":"string","description":"Risk note"},"organization_id":{"type":"string","format":"string"},"owner_id":{"anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No owner"}]},"residual_impact":{"type":"integer","description":"Residual impact"},"residual_likelihood":{"type":"integer","description":"Residual likelihood"},"residual_risk_score":{"type":"integer","description":"Residual risk score"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"treatment":{"type":"string","enum":["MITIGATED","ACCEPTED","AVOIDED","TRANSFERRED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}}`) + ListTasksToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id"],"properties":{"cursor":{"type":"string","format":"string"},"measure_id":{"type":"string","format":"string"},"order_by":{"type":"object","required":["field","direction"],"properties":{"direction":{"type":"string","enum":["ASC","DESC"]},"field":{"type":"string","enum":["CREATED_AT"]}}},"organization_id":{"type":"string","format":"string"},"size":{"type":"integer","description":"Page size"}}}`) + ListTasksToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["tasks"],"properties":{"next_cursor":{"description":"Next page cursor","anyOf":[{"type":"string","format":"string"},{"type":"null"}]},"tasks":{"type":"array","description":"List of tasks","items":{"type":"object","required":["id","organization_id","name","state","created_at","updated_at"],"properties":{"assigned_to_id":{"description":"Assigned to person ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"Not assigned"}]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"deadline":{"description":"Deadline","anyOf":[{"type":"string","description":"Deadline","format":"date-time"},{"type":"null","description":"No deadline"}]},"description":{"description":"Task description","anyOf":[{"type":"string","description":"Task description"},{"type":"null","description":"No description"}]},"id":{"type":"string","format":"string"},"measure_id":{"description":"Measure ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No measure"}]},"name":{"type":"string","description":"Task name"},"organization_id":{"type":"string","format":"string"},"state":{"type":"string","enum":["TODO","DONE"]},"time_estimate":{"description":"Time estimate","anyOf":[{"type":"string","description":"A duration"},{"type":"null","description":"No time estimate"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}}`) ListVendorsToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id"],"properties":{"cursor":{"type":"string","format":"string"},"filter":{"type":"object","properties":{"snapshot_id":{"type":"string","format":"string"}}},"order_by":{"type":"object","required":["field","direction"],"properties":{"direction":{"type":"string","enum":["ASC","DESC"]},"field":{"type":"string","enum":["CREATED_AT","UPDATED_AT","NAME"]}}},"organization_id":{"type":"string","format":"string"},"size":{"type":"integer","description":"Page size"}}}`) ListVendorsToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["vendors"],"properties":{"next_cursor":{"type":"string","format":"string"},"vendors":{"type":"array","items":{"type":"object","required":["id","name","organization_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Vendor description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Vendor name"},"organization_id":{"type":"string","format":"string"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}}`) + UnassignTaskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`) + UnassignTaskToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["task"],"properties":{"task":{"type":"object","required":["id","organization_id","name","state","created_at","updated_at"],"properties":{"assigned_to_id":{"description":"Assigned to person ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"Not assigned"}]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"deadline":{"description":"Deadline","anyOf":[{"type":"string","description":"Deadline","format":"date-time"},{"type":"null","description":"No deadline"}]},"description":{"description":"Task description","anyOf":[{"type":"string","description":"Task description"},{"type":"null","description":"No description"}]},"id":{"type":"string","format":"string"},"measure_id":{"description":"Measure ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No measure"}]},"name":{"type":"string","description":"Task name"},"organization_id":{"type":"string","format":"string"},"state":{"type":"string","enum":["TODO","DONE"]},"time_estimate":{"description":"Time estimate","anyOf":[{"type":"string","description":"A duration"},{"type":"null","description":"No time estimate"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) UnlinkControlAuditToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["control_id","audit_id"],"properties":{"audit_id":{"type":"string","format":"string"},"control_id":{"type":"string","format":"string"}}}`) UnlinkControlAuditToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object"}`) UnlinkControlDocumentToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["control_id","document_id"],"properties":{"control_id":{"type":"string","format":"string"},"document_id":{"type":"string","format":"string"}}}`) @@ -120,6 +130,8 @@ var ( UpdateObligationToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["obligation"],"properties":{"obligation":{"type":"object","required":["id","organization_id","owner_id","status","created_at","updated_at"],"properties":{"actions_to_be_implemented":{"description":"Actions to be implemented"},"area":{"description":"Area"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"due_date":{"description":"Due date","format":"date-time"},"id":{"type":"string","format":"string"},"last_review_date":{"description":"Last review date","format":"date-time"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"regulator":{"description":"Regulator"},"requirement":{"description":"Requirement"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"source":{"description":"Source"},"source_id":{"description":"Source ID"},"status":{"type":"string","enum":["NON_COMPLIANT","PARTIALLY_COMPLIANT","COMPLIANT"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) UpdateRiskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"category":{"type":"string","description":"Risk category"},"description":{"description":"Risk description"},"id":{"type":"string","format":"string"},"inherent_impact":{"type":"integer","description":"Inherent impact"},"inherent_likelihood":{"type":"integer","description":"Inherent likelihood"},"name":{"type":"string","description":"Risk name"},"note":{"type":"string","description":"Risk note"},"owner_id":{"description":"Owner ID","anyOf":[{"type":"string","format":"string"},{"type":"null"}]},"residual_impact":{"type":"integer","description":"Residual impact"},"residual_likelihood":{"type":"integer","description":"Residual likelihood"},"treatment":{"type":"string","enum":["MITIGATED","ACCEPTED","AVOIDED","TRANSFERRED"]}}}`) UpdateRiskToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["risk"],"properties":{"risk":{"type":"object","required":["id","organization_id","name","category","treatment","inherent_likelihood","inherent_impact","inherent_risk_score","residual_likelihood","residual_impact","residual_risk_score","note","created_at","updated_at"],"properties":{"category":{"type":"string","description":"Risk category"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Risk description"},"id":{"type":"string","format":"string"},"inherent_impact":{"type":"integer","description":"Inherent impact"},"inherent_likelihood":{"type":"integer","description":"Inherent likelihood"},"inherent_risk_score":{"type":"integer","description":"Inherent risk score"},"name":{"type":"string","description":"Risk name"},"note":{"type":"string","description":"Risk note"},"organization_id":{"type":"string","format":"string"},"owner_id":{"anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No owner"}]},"residual_impact":{"type":"integer","description":"Residual impact"},"residual_likelihood":{"type":"integer","description":"Residual likelihood"},"residual_risk_score":{"type":"integer","description":"Residual risk score"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"treatment":{"type":"string","enum":["MITIGATED","ACCEPTED","AVOIDED","TRANSFERRED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) + UpdateTaskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"deadline":{"description":"Deadline","anyOf":[{"type":"string","description":"Deadline","format":"date-time"},{"type":"null","description":"No deadline"}]},"description":{"description":"Task description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Task name"},"state":{"description":"Task state","anyOf":[{"type":"string","enum":["TODO","DONE"]},{"type":"null","description":"No state"}]},"time_estimate":{"description":"Time estimate","anyOf":[{"type":"string","description":"A duration"},{"type":"null","description":"No time estimate"}]}}}`) + UpdateTaskToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["task"],"properties":{"task":{"type":"object","required":["id","organization_id","name","state","created_at","updated_at"],"properties":{"assigned_to_id":{"description":"Assigned to person ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"Not assigned"}]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"deadline":{"description":"Deadline","anyOf":[{"type":"string","description":"Deadline","format":"date-time"},{"type":"null","description":"No deadline"}]},"description":{"description":"Task description","anyOf":[{"type":"string","description":"Task description"},{"type":"null","description":"No description"}]},"id":{"type":"string","format":"string"},"measure_id":{"description":"Measure ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No measure"}]},"name":{"type":"string","description":"Task name"},"organization_id":{"type":"string","format":"string"},"state":{"type":"string","enum":["TODO","DONE"]},"time_estimate":{"description":"Time estimate","anyOf":[{"type":"string","description":"A duration"},{"type":"null","description":"No time estimate"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) UpdateVendorToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"description":{"type":"string","description":"Vendor description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Vendor name"}}}`) UpdateVendorToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["vendor"],"properties":{"vendor":{"type":"object","required":["id","name","organization_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Vendor description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Vendor name"},"organization_id":{"type":"string","format":"string"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`) ) @@ -383,6 +395,29 @@ type AddRiskOutput struct { Risk *Risk `json:"risk"` } +// AddTaskInput represents the schema +type AddTaskInput struct { + // Assigned to person ID + AssignedToID *gid.GID `json:"assigned_to_id,omitempty"` + // Deadline + Deadline *time.Time `json:"deadline,omitempty"` + // Task description + Description *string `json:"description,omitempty"` + // Measure ID + MeasureID *gid.GID `json:"measure_id,omitempty"` + // Task name + Name string `json:"name"` + // Organization ID + OrganizationID gid.GID `json:"organization_id"` + // Time estimate + TimeEstimate *time.Duration `json:"time_estimate,omitempty"` +} + +// AddTaskOutput represents the schema +type AddTaskOutput struct { + Task *Task `json:"task"` +} + // AddVendorInput represents the schema type AddVendorInput struct { // Creation timestamp @@ -434,6 +469,19 @@ type AssetOrderBy struct { Field coredata.AssetOrderField `json:"field"` } +// AssignTaskInput represents the schema +type AssignTaskInput struct { + // Assigned to person ID + AssignedToID gid.GID `json:"assigned_to_id"` + // Task ID + ID gid.GID `json:"id"` +} + +// AssignTaskOutput represents the schema +type AssignTaskOutput struct { + Task *Task `json:"task"` +} + // Audit represents the schema type Audit struct { // Creation timestamp @@ -709,6 +757,17 @@ type GetRiskOutput struct { Risk *Risk `json:"risk"` } +// GetTaskInput represents the schema +type GetTaskInput struct { + // Task ID + ID gid.GID `json:"id"` +} + +// GetTaskOutput represents the schema +type GetTaskOutput struct { + Task *Task `json:"task"` +} + // LinkControlAuditInput represents the schema type LinkControlAuditInput struct { // Audit ID @@ -988,6 +1047,28 @@ type ListRisksOutput struct { Risks []*Risk `json:"risks"` } +// ListTasksInput represents the schema +type ListTasksInput struct { + // Page cursor + Cursor *page.CursorKey `json:"cursor,omitempty"` + // Measure ID + MeasureID *gid.GID `json:"measure_id,omitempty"` + // Task order by + OrderBy *TaskOrderBy `json:"order_by,omitempty"` + // Organization ID + OrganizationID gid.GID `json:"organization_id"` + // Page size + Size *int `json:"size,omitempty"` +} + +// ListTasksOutput represents the schema +type ListTasksOutput struct { + // Next page cursor + NextCursor *page.CursorKey `json:"next_cursor,omitempty"` + // List of tasks + Tasks []*Task `json:"tasks"` +} + // ListVendorsInput represents the schema type ListVendorsInput struct { // Page cursor @@ -1211,6 +1292,51 @@ type RiskOrderBy struct { Field coredata.RiskOrderField `json:"field"` } +// Task represents the schema +type Task struct { + // Assigned to person ID + AssignedToID *gid.GID `json:"assigned_to_id,omitempty"` + // Creation timestamp + CreatedAt time.Time `json:"created_at"` + // Deadline + Deadline *time.Time `json:"deadline,omitempty"` + // Task description + Description *string `json:"description,omitempty"` + // Task ID + ID gid.GID `json:"id"` + // Measure ID + MeasureID *gid.GID `json:"measure_id,omitempty"` + // Task name + Name string `json:"name"` + // Organization ID + OrganizationID gid.GID `json:"organization_id"` + // Task state + State coredata.TaskState `json:"state"` + // Time estimate + TimeEstimate *time.Duration `json:"time_estimate,omitempty"` + // Update timestamp + UpdatedAt time.Time `json:"updated_at"` +} + +// TaskOrderBy represents the schema +type TaskOrderBy struct { + // Task order direction + Direction page.OrderDirection `json:"direction"` + // Task order field + Field coredata.TaskOrderField `json:"field"` +} + +// UnassignTaskInput represents the schema +type UnassignTaskInput struct { + // Task ID + ID gid.GID `json:"id"` +} + +// UnassignTaskOutput represents the schema +type UnassignTaskOutput struct { + Task *Task `json:"task"` +} + // UnlinkControlAuditInput represents the schema type UnlinkControlAuditInput struct { // Audit ID @@ -1493,6 +1619,27 @@ type UpdateRiskOutput struct { Risk *Risk `json:"risk"` } +// UpdateTaskInput represents the schema +type UpdateTaskInput struct { + // Deadline + Deadline mcp.Omittable[*time.Time] `json:"deadline,omitempty"` + // Task description + Description mcp.Omittable[*string] `json:"description,omitempty"` + // Task ID + ID gid.GID `json:"id"` + // Task name + Name *string `json:"name,omitempty"` + // Task state + State *coredata.TaskState `json:"state,omitempty"` + // Time estimate + TimeEstimate mcp.Omittable[*time.Duration] `json:"time_estimate,omitempty"` +} + +// UpdateTaskOutput represents the schema +type UpdateTaskOutput struct { + Task *Task `json:"task"` +} + // UpdateVendorInput represents the schema type UpdateVendorInput struct { // Vendor description