Add document and document version tools
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -1445,3 +1445,316 @@ func (r *Resolver) TakeSnapshotTool(ctx context.Context, req *mcp.CallToolReques
|
||||
Snapshot: types.NewSnapshot(snapshot),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) ListDocumentsTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListDocumentsInput) (*mcp.CallToolResult, types.ListDocumentsOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.OrganizationID, authz.ActionListDocuments)
|
||||
|
||||
prb := r.ProboService(ctx, input.OrganizationID)
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: coredata.DocumentOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if input.OrderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentOrderField]{
|
||||
Field: input.OrderBy.Field,
|
||||
Direction: input.OrderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
||||
|
||||
documentFilter := coredata.NewDocumentFilter(nil)
|
||||
if input.Filter != nil {
|
||||
var query *string
|
||||
if input.Filter.Query != nil && *input.Filter.Query != "" {
|
||||
query = input.Filter.Query
|
||||
}
|
||||
|
||||
documentFilter = coredata.NewDocumentFilter(query)
|
||||
}
|
||||
|
||||
page, err := prb.Documents.ListByOrganizationID(ctx, input.OrganizationID, cursor, documentFilter)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list organization documents: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.NewListDocumentsOutput(page), nil
|
||||
}
|
||||
|
||||
func (r *Resolver) GetDocumentTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetDocumentInput) (*mcp.CallToolResult, types.GetDocumentOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.ID, authz.ActionDocument)
|
||||
|
||||
prb := r.ProboService(ctx, input.ID)
|
||||
|
||||
document, err := prb.Documents.Get(ctx, input.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get document: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.GetDocumentOutput{
|
||||
Document: types.NewDocument(document),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) AddDocumentTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddDocumentInput) (*mcp.CallToolResult, types.AddDocumentOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.OrganizationID, authz.ActionCreateDocument)
|
||||
|
||||
svc := r.ProboService(ctx, input.OrganizationID)
|
||||
|
||||
var trustCenterVisibility *coredata.TrustCenterVisibility
|
||||
if input.TrustCenterVisibility != nil {
|
||||
trustCenterVisibility = input.TrustCenterVisibility
|
||||
}
|
||||
|
||||
document, documentVersion, err := svc.Documents.Create(
|
||||
ctx,
|
||||
probo.CreateDocumentRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
Title: input.Title,
|
||||
Content: input.Content,
|
||||
OwnerID: input.OwnerID,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
TrustCenterVisibility: trustCenterVisibility,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot create document: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.NewAddDocumentOutput(document, documentVersion), nil
|
||||
}
|
||||
|
||||
func (r *Resolver) UpdateDocumentTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateDocumentInput) (*mcp.CallToolResult, types.UpdateDocumentOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.ID, authz.ActionUpdateDocument)
|
||||
|
||||
svc := r.ProboService(ctx, input.ID)
|
||||
|
||||
document, err := svc.Documents.Update(
|
||||
ctx,
|
||||
probo.UpdateDocumentRequest{
|
||||
DocumentID: input.ID,
|
||||
Title: input.Title,
|
||||
OwnerID: input.OwnerID,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot update document: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.UpdateDocumentOutput{
|
||||
Document: types.NewDocument(document),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) ListDocumentVersionsTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListDocumentVersionsInput) (*mcp.CallToolResult, types.ListDocumentVersionsOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentID, authz.ActionDocumentVersion)
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.DocumentVersionOrderField]{
|
||||
Field: coredata.DocumentVersionOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if input.OrderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentVersionOrderField]{
|
||||
Field: input.OrderBy.Field,
|
||||
Direction: input.OrderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
||||
svc := r.ProboService(ctx, input.DocumentID)
|
||||
|
||||
page, err := svc.Documents.ListVersions(ctx, input.DocumentID, cursor)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list document versions: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.NewListDocumentVersionsOutput(page), nil
|
||||
}
|
||||
|
||||
func (r *Resolver) GetDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetDocumentVersionInput) (*mcp.CallToolResult, types.GetDocumentVersionOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.ID, authz.ActionDocumentVersion)
|
||||
|
||||
svc := r.ProboService(ctx, input.ID)
|
||||
|
||||
version, err := svc.Documents.GetVersion(ctx, input.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get document version: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.GetDocumentVersionOutput{
|
||||
DocumentVersion: types.NewDocumentVersion(version),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) CreateDraftDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.CreateDraftDocumentVersionInput) (*mcp.CallToolResult, types.CreateDraftDocumentVersionOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentID, authz.ActionCreateDraftDocumentVersion)
|
||||
|
||||
svc := r.ProboService(ctx, input.DocumentID)
|
||||
|
||||
draftVersion, err := svc.Documents.CreateDraft(ctx, input.DocumentID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot create draft document version: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.CreateDraftDocumentVersionOutput{
|
||||
DocumentVersion: types.NewDocumentVersion(draftVersion),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) UpdateDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateDocumentVersionInput) (*mcp.CallToolResult, types.UpdateDocumentVersionOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentVersionID, authz.ActionUpdateDocumentVersion)
|
||||
|
||||
svc := r.ProboService(ctx, input.DocumentVersionID)
|
||||
|
||||
documentVersion, err := svc.Documents.UpdateVersion(
|
||||
ctx,
|
||||
probo.UpdateDocumentVersionRequest{
|
||||
ID: input.DocumentVersionID,
|
||||
Content: input.Content,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot update document version: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.UpdateDocumentVersionOutput{
|
||||
DocumentVersion: types.NewDocumentVersion(documentVersion),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) PublishDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.PublishDocumentVersionInput) (*mcp.CallToolResult, types.PublishDocumentVersionOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentID, authz.ActionPublishDocumentVersion)
|
||||
|
||||
svc := r.ProboService(ctx, input.DocumentID)
|
||||
|
||||
user := serverauth.UserFromContext(ctx)
|
||||
|
||||
document, documentVersion, err := svc.Documents.PublishVersion(ctx, input.DocumentID, user.ID, input.Changelog)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot publish document version: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.PublishDocumentVersionOutput{
|
||||
Document: types.NewDocument(document),
|
||||
DocumentVersion: types.NewDocumentVersion(documentVersion),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) ListDocumentVersionSignaturesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListDocumentVersionSignaturesInput) (*mcp.CallToolResult, types.ListDocumentVersionSignaturesOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentVersionID, authz.ActionDocumentVersion)
|
||||
|
||||
prb := r.ProboService(ctx, input.DocumentVersionID)
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.DocumentVersionSignatureOrderField]{
|
||||
Field: coredata.DocumentVersionSignatureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if input.OrderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.DocumentVersionSignatureOrderField]{
|
||||
Field: input.OrderBy.Field,
|
||||
Direction: input.OrderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
||||
|
||||
var signatureFilter *coredata.DocumentVersionSignatureFilter
|
||||
if input.Filter != nil && input.Filter.States != nil && len(input.Filter.States) > 0 {
|
||||
signatureFilter = coredata.NewDocumentVersionSignatureFilter(input.Filter.States)
|
||||
} else {
|
||||
signatureFilter = coredata.NewDocumentVersionSignatureFilter(nil)
|
||||
}
|
||||
|
||||
page, err := prb.Documents.ListSignatures(ctx, input.DocumentVersionID, cursor, signatureFilter)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list document version signatures: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.NewListDocumentVersionSignaturesOutput(page), nil
|
||||
}
|
||||
|
||||
func (r *Resolver) GetDocumentVersionSignatureTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetDocumentVersionSignatureInput) (*mcp.CallToolResult, types.GetDocumentVersionSignatureOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.ID, authz.ActionDocumentVersion)
|
||||
|
||||
prb := r.ProboService(ctx, input.ID)
|
||||
|
||||
signature, err := prb.Documents.GetVersionSignature(ctx, input.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get document version signature: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.GetDocumentVersionSignatureOutput{
|
||||
DocumentVersionSignature: types.NewDocumentVersionSignature(signature),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) RequestDocumentVersionSignatureTool(ctx context.Context, req *mcp.CallToolRequest, input *types.RequestDocumentVersionSignatureInput) (*mcp.CallToolResult, types.RequestDocumentVersionSignatureOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentVersionID, authz.ActionRequestSignature)
|
||||
|
||||
svc := r.ProboService(ctx, input.DocumentVersionID)
|
||||
|
||||
documentVersionSignature, err := svc.Documents.RequestSignature(
|
||||
ctx,
|
||||
probo.RequestSignatureRequest{
|
||||
DocumentVersionID: input.DocumentVersionID,
|
||||
Signatory: input.SignatoryID,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot request signature: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.RequestDocumentVersionSignatureOutput{
|
||||
DocumentVersionSignature: types.NewDocumentVersionSignature(documentVersionSignature),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) DeleteDraftDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteDraftDocumentVersionInput) (*mcp.CallToolResult, types.DeleteDraftDocumentVersionOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentVersionID, authz.ActionDeleteDraftDocumentVersion)
|
||||
|
||||
svc := r.ProboService(ctx, input.DocumentVersionID)
|
||||
|
||||
err := svc.Documents.DeleteDraft(ctx, input.DocumentVersionID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot delete draft document version: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.DeleteDraftDocumentVersionOutput{
|
||||
DeletedDocumentVersionID: input.DocumentVersionID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) DeleteDocumentTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteDocumentInput) (*mcp.CallToolResult, types.DeleteDocumentOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentID, authz.ActionDeleteDocument)
|
||||
|
||||
svc := r.ProboService(ctx, input.DocumentID)
|
||||
|
||||
err := svc.Documents.SoftDelete(ctx, input.DocumentID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot soft delete document: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.DeleteDocumentOutput{
|
||||
DeletedDocumentID: input.DocumentID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *Resolver) CancelSignatureRequestTool(ctx context.Context, req *mcp.CallToolRequest, input *types.CancelSignatureRequestInput) (*mcp.CallToolResult, types.CancelSignatureRequestOutput, error) {
|
||||
r.MustBeAuthorized(ctx, input.DocumentVersionSignatureID, authz.ActionCancelSignatureRequest)
|
||||
|
||||
svc := r.ProboService(ctx, input.DocumentVersionSignatureID)
|
||||
|
||||
err := svc.Documents.CancelSignatureRequest(ctx, input.DocumentVersionSignatureID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot cancel signature request: %w", err))
|
||||
}
|
||||
|
||||
return nil, types.CancelSignatureRequestOutput{
|
||||
DeletedDocumentVersionSignatureID: input.DocumentVersionSignatureID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -74,6 +74,21 @@ type ResolverInterface interface {
|
||||
ListSnapshotsTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListSnapshotsInput) (*mcp.CallToolResult, types.ListSnapshotsOutput, error)
|
||||
GetSnapshotTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetSnapshotInput) (*mcp.CallToolResult, types.GetSnapshotOutput, error)
|
||||
TakeSnapshotTool(ctx context.Context, req *mcp.CallToolRequest, input *types.TakeSnapshotInput) (*mcp.CallToolResult, types.TakeSnapshotOutput, error)
|
||||
ListDocumentsTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListDocumentsInput) (*mcp.CallToolResult, types.ListDocumentsOutput, error)
|
||||
GetDocumentTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetDocumentInput) (*mcp.CallToolResult, types.GetDocumentOutput, error)
|
||||
AddDocumentTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddDocumentInput) (*mcp.CallToolResult, types.AddDocumentOutput, error)
|
||||
UpdateDocumentTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateDocumentInput) (*mcp.CallToolResult, types.UpdateDocumentOutput, error)
|
||||
ListDocumentVersionsTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListDocumentVersionsInput) (*mcp.CallToolResult, types.ListDocumentVersionsOutput, error)
|
||||
GetDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetDocumentVersionInput) (*mcp.CallToolResult, types.GetDocumentVersionOutput, error)
|
||||
CreateDraftDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.CreateDraftDocumentVersionInput) (*mcp.CallToolResult, types.CreateDraftDocumentVersionOutput, error)
|
||||
UpdateDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateDocumentVersionInput) (*mcp.CallToolResult, types.UpdateDocumentVersionOutput, error)
|
||||
DeleteDraftDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteDraftDocumentVersionInput) (*mcp.CallToolResult, types.DeleteDraftDocumentVersionOutput, error)
|
||||
PublishDocumentVersionTool(ctx context.Context, req *mcp.CallToolRequest, input *types.PublishDocumentVersionInput) (*mcp.CallToolResult, types.PublishDocumentVersionOutput, error)
|
||||
DeleteDocumentTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteDocumentInput) (*mcp.CallToolResult, types.DeleteDocumentOutput, error)
|
||||
ListDocumentVersionSignaturesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListDocumentVersionSignaturesInput) (*mcp.CallToolResult, types.ListDocumentVersionSignaturesOutput, error)
|
||||
GetDocumentVersionSignatureTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetDocumentVersionSignatureInput) (*mcp.CallToolResult, types.GetDocumentVersionSignatureOutput, error)
|
||||
RequestDocumentVersionSignatureTool(ctx context.Context, req *mcp.CallToolRequest, input *types.RequestDocumentVersionSignatureInput) (*mcp.CallToolResult, types.RequestDocumentVersionSignatureOutput, error)
|
||||
CancelSignatureRequestTool(ctx context.Context, req *mcp.CallToolRequest, input *types.CancelSignatureRequestInput) (*mcp.CallToolResult, types.CancelSignatureRequestOutput, error)
|
||||
}
|
||||
|
||||
// New creates a new MCP server instance with all handlers registered.
|
||||
@@ -845,6 +860,186 @@ func registerToolHandlers(server *mcp.Server, resolver ResolverInterface) {
|
||||
},
|
||||
resolver.TakeSnapshotTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "listDocuments",
|
||||
Description: "List all documents for the organization",
|
||||
InputSchema: types.ListDocumentsToolInputSchema,
|
||||
OutputSchema: types.ListDocumentsToolOutputSchema,
|
||||
Annotations: &mcp.ToolAnnotations{
|
||||
ReadOnlyHint: true,
|
||||
IdempotentHint: true,
|
||||
},
|
||||
},
|
||||
resolver.ListDocumentsTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "getDocument",
|
||||
Description: "Get a document by ID",
|
||||
InputSchema: types.GetDocumentToolInputSchema,
|
||||
OutputSchema: types.GetDocumentToolOutputSchema,
|
||||
Annotations: &mcp.ToolAnnotations{
|
||||
ReadOnlyHint: true,
|
||||
IdempotentHint: true,
|
||||
},
|
||||
},
|
||||
resolver.GetDocumentTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "addDocument",
|
||||
Description: "Add a new document to the organization",
|
||||
InputSchema: types.AddDocumentToolInputSchema,
|
||||
OutputSchema: types.AddDocumentToolOutputSchema,
|
||||
},
|
||||
resolver.AddDocumentTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "updateDocument",
|
||||
Description: "Update an existing document",
|
||||
InputSchema: types.UpdateDocumentToolInputSchema,
|
||||
OutputSchema: types.UpdateDocumentToolOutputSchema,
|
||||
},
|
||||
resolver.UpdateDocumentTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "listDocumentVersions",
|
||||
Description: "List all versions for a document",
|
||||
InputSchema: types.ListDocumentVersionsToolInputSchema,
|
||||
OutputSchema: types.ListDocumentVersionsToolOutputSchema,
|
||||
Annotations: &mcp.ToolAnnotations{
|
||||
ReadOnlyHint: true,
|
||||
IdempotentHint: true,
|
||||
},
|
||||
},
|
||||
resolver.ListDocumentVersionsTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "getDocumentVersion",
|
||||
Description: "Get a document version by ID",
|
||||
InputSchema: types.GetDocumentVersionToolInputSchema,
|
||||
OutputSchema: types.GetDocumentVersionToolOutputSchema,
|
||||
Annotations: &mcp.ToolAnnotations{
|
||||
ReadOnlyHint: true,
|
||||
IdempotentHint: true,
|
||||
},
|
||||
},
|
||||
resolver.GetDocumentVersionTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "createDraftDocumentVersion",
|
||||
Description: "Create a new draft version from the latest published version",
|
||||
InputSchema: types.CreateDraftDocumentVersionToolInputSchema,
|
||||
OutputSchema: types.CreateDraftDocumentVersionToolOutputSchema,
|
||||
},
|
||||
resolver.CreateDraftDocumentVersionTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "updateDocumentVersion",
|
||||
Description: "Update an existing draft document version content",
|
||||
InputSchema: types.UpdateDocumentVersionToolInputSchema,
|
||||
OutputSchema: types.UpdateDocumentVersionToolOutputSchema,
|
||||
},
|
||||
resolver.UpdateDocumentVersionTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "deleteDraftDocumentVersion",
|
||||
Description: "Delete a draft document version",
|
||||
InputSchema: types.DeleteDraftDocumentVersionToolInputSchema,
|
||||
OutputSchema: types.DeleteDraftDocumentVersionToolOutputSchema,
|
||||
},
|
||||
resolver.DeleteDraftDocumentVersionTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "publishDocumentVersion",
|
||||
Description: "Publish a draft document version",
|
||||
InputSchema: types.PublishDocumentVersionToolInputSchema,
|
||||
OutputSchema: types.PublishDocumentVersionToolOutputSchema,
|
||||
},
|
||||
resolver.PublishDocumentVersionTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "deleteDocument",
|
||||
Description: "Delete a document",
|
||||
InputSchema: types.DeleteDocumentToolInputSchema,
|
||||
OutputSchema: types.DeleteDocumentToolOutputSchema,
|
||||
Annotations: &mcp.ToolAnnotations{
|
||||
DestructiveHint: boolPtr(true),
|
||||
},
|
||||
},
|
||||
resolver.DeleteDocumentTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "listDocumentVersionSignatures",
|
||||
Description: "List all signatures for a document version",
|
||||
InputSchema: types.ListDocumentVersionSignaturesToolInputSchema,
|
||||
OutputSchema: types.ListDocumentVersionSignaturesToolOutputSchema,
|
||||
Annotations: &mcp.ToolAnnotations{
|
||||
ReadOnlyHint: true,
|
||||
IdempotentHint: true,
|
||||
},
|
||||
},
|
||||
resolver.ListDocumentVersionSignaturesTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "getDocumentVersionSignature",
|
||||
Description: "Get a document version signature by ID",
|
||||
InputSchema: types.GetDocumentVersionSignatureToolInputSchema,
|
||||
OutputSchema: types.GetDocumentVersionSignatureToolOutputSchema,
|
||||
Annotations: &mcp.ToolAnnotations{
|
||||
ReadOnlyHint: true,
|
||||
IdempotentHint: true,
|
||||
},
|
||||
},
|
||||
resolver.GetDocumentVersionSignatureTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "requestDocumentVersionSignature",
|
||||
Description: "Request a signature for a document version",
|
||||
InputSchema: types.RequestDocumentVersionSignatureToolInputSchema,
|
||||
OutputSchema: types.RequestDocumentVersionSignatureToolOutputSchema,
|
||||
},
|
||||
resolver.RequestDocumentVersionSignatureTool,
|
||||
)
|
||||
mcp.AddTool(
|
||||
server,
|
||||
&mcp.Tool{
|
||||
Name: "cancelSignatureRequest",
|
||||
Description: "Cancel a document version signature request",
|
||||
InputSchema: types.CancelSignatureRequestToolInputSchema,
|
||||
OutputSchema: types.CancelSignatureRequestToolOutputSchema,
|
||||
Annotations: &mcp.ToolAnnotations{
|
||||
DestructiveHint: boolPtr(true),
|
||||
},
|
||||
},
|
||||
resolver.CancelSignatureRequestTool,
|
||||
)
|
||||
}
|
||||
|
||||
func boolPtr(b bool) *bool {
|
||||
|
||||
@@ -3209,6 +3209,628 @@ components:
|
||||
snapshot:
|
||||
$ref: "#/components/schemas/Snapshot"
|
||||
|
||||
DocumentType:
|
||||
type: string
|
||||
enum:
|
||||
- OTHER
|
||||
- ISMS
|
||||
- POLICY
|
||||
- PROCEDURE
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.DocumentType
|
||||
|
||||
DocumentClassification:
|
||||
type: string
|
||||
enum:
|
||||
- PUBLIC
|
||||
- INTERNAL
|
||||
- CONFIDENTIAL
|
||||
- SECRET
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.DocumentClassification
|
||||
|
||||
DocumentStatus:
|
||||
type: string
|
||||
enum:
|
||||
- DRAFT
|
||||
- PUBLISHED
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.DocumentStatus
|
||||
|
||||
DocumentVersionSignatureState:
|
||||
type: string
|
||||
enum:
|
||||
- REQUESTED
|
||||
- SIGNED
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.DocumentVersionSignatureState
|
||||
|
||||
DocumentOrderField:
|
||||
type: string
|
||||
enum:
|
||||
- CREATED_AT
|
||||
- TITLE
|
||||
- DOCUMENT_TYPE
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.DocumentOrderField
|
||||
|
||||
DocumentOrderBy:
|
||||
type: object
|
||||
required:
|
||||
- field
|
||||
- direction
|
||||
properties:
|
||||
field:
|
||||
$ref: "#/components/schemas/DocumentOrderField"
|
||||
description: Document order field
|
||||
direction:
|
||||
$ref: "#/components/schemas/OrderDirection"
|
||||
description: Document order direction
|
||||
|
||||
DocumentVersionOrderField:
|
||||
type: string
|
||||
enum:
|
||||
- CREATED_AT
|
||||
- VERSION
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.DocumentVersionOrderField
|
||||
|
||||
DocumentVersionOrderBy:
|
||||
type: object
|
||||
required:
|
||||
- field
|
||||
- direction
|
||||
properties:
|
||||
field:
|
||||
$ref: "#/components/schemas/DocumentVersionOrderField"
|
||||
description: Document version order field
|
||||
direction:
|
||||
$ref: "#/components/schemas/OrderDirection"
|
||||
description: Document version order direction
|
||||
|
||||
DocumentVersionSignatureOrderField:
|
||||
type: string
|
||||
enum:
|
||||
- CREATED_AT
|
||||
- SIGNED_AT
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.DocumentVersionSignatureOrderField
|
||||
|
||||
DocumentVersionSignatureOrderBy:
|
||||
type: object
|
||||
required:
|
||||
- field
|
||||
- direction
|
||||
properties:
|
||||
field:
|
||||
$ref: "#/components/schemas/DocumentVersionSignatureOrderField"
|
||||
description: Document version signature order field
|
||||
direction:
|
||||
$ref: "#/components/schemas/OrderDirection"
|
||||
description: Document version signature order direction
|
||||
|
||||
Document:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- organization_id
|
||||
- owner_id
|
||||
- title
|
||||
- document_type
|
||||
- classification
|
||||
- trust_center_visibility
|
||||
- created_at
|
||||
- updated_at
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document ID
|
||||
organization_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Organization ID
|
||||
owner_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Owner ID
|
||||
title:
|
||||
type: string
|
||||
description: Document title
|
||||
document_type:
|
||||
$ref: "#/components/schemas/DocumentType"
|
||||
description: Document type
|
||||
classification:
|
||||
$ref: "#/components/schemas/DocumentClassification"
|
||||
description: Document classification
|
||||
current_published_version:
|
||||
type:
|
||||
- integer
|
||||
- "null"
|
||||
description: Current published version number
|
||||
trust_center_visibility:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibility
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Creation timestamp
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Update timestamp
|
||||
|
||||
DocumentVersion:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- organization_id
|
||||
- document_id
|
||||
- title
|
||||
- owner_id
|
||||
- version_number
|
||||
- classification
|
||||
- content
|
||||
- changelog
|
||||
- status
|
||||
- created_at
|
||||
- updated_at
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version ID
|
||||
organization_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Organization ID
|
||||
document_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document ID
|
||||
title:
|
||||
type: string
|
||||
description: Document version title
|
||||
owner_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Owner ID
|
||||
version_number:
|
||||
type: integer
|
||||
description: Version number
|
||||
classification:
|
||||
$ref: "#/components/schemas/DocumentClassification"
|
||||
description: Document classification
|
||||
content:
|
||||
type: string
|
||||
description: Document content
|
||||
changelog:
|
||||
type: string
|
||||
description: Changelog
|
||||
status:
|
||||
$ref: "#/components/schemas/DocumentStatus"
|
||||
description: Document status
|
||||
published_at:
|
||||
type:
|
||||
- string
|
||||
- "null"
|
||||
format: date-time
|
||||
description: Published timestamp
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Creation timestamp
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Update timestamp
|
||||
|
||||
DocumentVersionSignature:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- organization_id
|
||||
- document_version_id
|
||||
- state
|
||||
- signed_by
|
||||
- requested_at
|
||||
- created_at
|
||||
- updated_at
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version signature ID
|
||||
organization_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Organization ID
|
||||
document_version_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version ID
|
||||
state:
|
||||
$ref: "#/components/schemas/DocumentVersionSignatureState"
|
||||
description: Signature state
|
||||
signed_by:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Signatory ID
|
||||
signed_at:
|
||||
type:
|
||||
- string
|
||||
- "null"
|
||||
format: date-time
|
||||
description: Signed timestamp
|
||||
requested_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Requested timestamp
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Creation timestamp
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Update timestamp
|
||||
|
||||
ListDocumentsInput:
|
||||
type: object
|
||||
required:
|
||||
- organization_id
|
||||
properties:
|
||||
organization_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Organization ID
|
||||
order_by:
|
||||
$ref: "#/components/schemas/DocumentOrderBy"
|
||||
description: Document order by
|
||||
size:
|
||||
type: integer
|
||||
description: Page size
|
||||
cursor:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Page cursor
|
||||
filter:
|
||||
type: object
|
||||
properties:
|
||||
query:
|
||||
type: string
|
||||
description: Search query
|
||||
trust_center_visibilities:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibilities
|
||||
|
||||
ListDocumentsOutput:
|
||||
type: object
|
||||
required:
|
||||
- documents
|
||||
properties:
|
||||
next_cursor:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Next cursor
|
||||
documents:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Document"
|
||||
|
||||
GetDocumentInput:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document ID
|
||||
|
||||
GetDocumentOutput:
|
||||
type: object
|
||||
required:
|
||||
- document
|
||||
properties:
|
||||
document:
|
||||
$ref: "#/components/schemas/Document"
|
||||
|
||||
AddDocumentInput:
|
||||
type: object
|
||||
required:
|
||||
- organization_id
|
||||
- title
|
||||
- content
|
||||
- owner_id
|
||||
- classification
|
||||
- document_type
|
||||
properties:
|
||||
organization_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Organization ID
|
||||
title:
|
||||
type: string
|
||||
description: Document title
|
||||
content:
|
||||
type: string
|
||||
description: Document content
|
||||
owner_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Owner ID
|
||||
classification:
|
||||
$ref: "#/components/schemas/DocumentClassification"
|
||||
description: Document classification
|
||||
document_type:
|
||||
$ref: "#/components/schemas/DocumentType"
|
||||
description: Document type
|
||||
trust_center_visibility:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibility
|
||||
|
||||
AddDocumentOutput:
|
||||
type: object
|
||||
required:
|
||||
- document
|
||||
- document_version
|
||||
properties:
|
||||
document:
|
||||
$ref: "#/components/schemas/Document"
|
||||
document_version:
|
||||
$ref: "#/components/schemas/DocumentVersion"
|
||||
|
||||
UpdateDocumentInput:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document ID
|
||||
title:
|
||||
type: string
|
||||
description: Document title
|
||||
owner_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Owner ID
|
||||
classification:
|
||||
$ref: "#/components/schemas/DocumentClassification"
|
||||
description: Document classification
|
||||
document_type:
|
||||
$ref: "#/components/schemas/DocumentType"
|
||||
description: Document type
|
||||
trust_center_visibility:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibility
|
||||
|
||||
UpdateDocumentOutput:
|
||||
type: object
|
||||
required:
|
||||
- document
|
||||
properties:
|
||||
document:
|
||||
$ref: "#/components/schemas/Document"
|
||||
|
||||
ListDocumentVersionsInput:
|
||||
type: object
|
||||
required:
|
||||
- document_id
|
||||
properties:
|
||||
document_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document ID
|
||||
order_by:
|
||||
$ref: "#/components/schemas/DocumentVersionOrderBy"
|
||||
description: Document version order by
|
||||
size:
|
||||
type: integer
|
||||
description: Page size
|
||||
cursor:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Page cursor
|
||||
|
||||
ListDocumentVersionsOutput:
|
||||
type: object
|
||||
required:
|
||||
- document_versions
|
||||
properties:
|
||||
next_cursor:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Next cursor
|
||||
document_versions:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/DocumentVersion"
|
||||
|
||||
GetDocumentVersionInput:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version ID
|
||||
|
||||
GetDocumentVersionOutput:
|
||||
type: object
|
||||
required:
|
||||
- document_version
|
||||
properties:
|
||||
document_version:
|
||||
$ref: "#/components/schemas/DocumentVersion"
|
||||
|
||||
CreateDraftDocumentVersionInput:
|
||||
type: object
|
||||
required:
|
||||
- document_id
|
||||
properties:
|
||||
document_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document ID
|
||||
|
||||
CreateDraftDocumentVersionOutput:
|
||||
type: object
|
||||
required:
|
||||
- document_version
|
||||
properties:
|
||||
document_version:
|
||||
$ref: "#/components/schemas/DocumentVersion"
|
||||
|
||||
UpdateDocumentVersionInput:
|
||||
type: object
|
||||
required:
|
||||
- document_version_id
|
||||
- content
|
||||
properties:
|
||||
document_version_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version ID
|
||||
content:
|
||||
type: string
|
||||
description: Document content
|
||||
|
||||
UpdateDocumentVersionOutput:
|
||||
type: object
|
||||
required:
|
||||
- document_version
|
||||
properties:
|
||||
document_version:
|
||||
$ref: "#/components/schemas/DocumentVersion"
|
||||
|
||||
DeleteDraftDocumentVersionInput:
|
||||
type: object
|
||||
required:
|
||||
- document_version_id
|
||||
properties:
|
||||
document_version_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version ID
|
||||
|
||||
DeleteDraftDocumentVersionOutput:
|
||||
type: object
|
||||
required:
|
||||
- deleted_document_version_id
|
||||
properties:
|
||||
deleted_document_version_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Deleted document version ID
|
||||
|
||||
PublishDocumentVersionInput:
|
||||
type: object
|
||||
required:
|
||||
- document_id
|
||||
properties:
|
||||
document_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document ID
|
||||
changelog:
|
||||
type: string
|
||||
description: Changelog
|
||||
|
||||
PublishDocumentVersionOutput:
|
||||
type: object
|
||||
required:
|
||||
- document
|
||||
- document_version
|
||||
properties:
|
||||
document:
|
||||
$ref: "#/components/schemas/Document"
|
||||
document_version:
|
||||
$ref: "#/components/schemas/DocumentVersion"
|
||||
|
||||
DeleteDocumentInput:
|
||||
type: object
|
||||
required:
|
||||
- document_id
|
||||
properties:
|
||||
document_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document ID
|
||||
|
||||
DeleteDocumentOutput:
|
||||
type: object
|
||||
required:
|
||||
- deleted_document_id
|
||||
properties:
|
||||
deleted_document_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Deleted document ID
|
||||
|
||||
ListDocumentVersionSignaturesInput:
|
||||
type: object
|
||||
required:
|
||||
- document_version_id
|
||||
properties:
|
||||
document_version_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version ID
|
||||
order_by:
|
||||
$ref: "#/components/schemas/DocumentVersionSignatureOrderBy"
|
||||
description: Document version signature order by
|
||||
size:
|
||||
type: integer
|
||||
description: Page size
|
||||
cursor:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Page cursor
|
||||
filter:
|
||||
type: object
|
||||
properties:
|
||||
states:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/DocumentVersionSignatureState"
|
||||
description: Signature states
|
||||
|
||||
ListDocumentVersionSignaturesOutput:
|
||||
type: object
|
||||
required:
|
||||
- document_version_signatures
|
||||
properties:
|
||||
next_cursor:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Next cursor
|
||||
document_version_signatures:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/DocumentVersionSignature"
|
||||
|
||||
GetDocumentVersionSignatureInput:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version signature ID
|
||||
|
||||
GetDocumentVersionSignatureOutput:
|
||||
type: object
|
||||
required:
|
||||
- document_version_signature
|
||||
properties:
|
||||
document_version_signature:
|
||||
$ref: "#/components/schemas/DocumentVersionSignature"
|
||||
|
||||
RequestDocumentVersionSignatureInput:
|
||||
type: object
|
||||
required:
|
||||
- document_version_id
|
||||
- signatory_id
|
||||
properties:
|
||||
document_version_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version ID
|
||||
signatory_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Signatory ID (People ID)
|
||||
|
||||
RequestDocumentVersionSignatureOutput:
|
||||
type: object
|
||||
required:
|
||||
- document_version_signature
|
||||
properties:
|
||||
document_version_signature:
|
||||
$ref: "#/components/schemas/DocumentVersionSignature"
|
||||
|
||||
CancelSignatureRequestInput:
|
||||
type: object
|
||||
required:
|
||||
- document_version_signature_id
|
||||
properties:
|
||||
document_version_signature_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document version signature ID
|
||||
|
||||
CancelSignatureRequestOutput:
|
||||
type: object
|
||||
required:
|
||||
- deleted_document_version_signature_id
|
||||
properties:
|
||||
deleted_document_version_signature_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Deleted document version signature ID
|
||||
|
||||
tools:
|
||||
- name: listOrganizations
|
||||
description: List all organizations the user has access to
|
||||
@@ -3750,3 +4372,131 @@ tools:
|
||||
$ref: "#/components/schemas/TakeSnapshotInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/TakeSnapshotOutput"
|
||||
- name: listDocuments
|
||||
description: List all documents for the organization
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/ListDocumentsInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/ListDocumentsOutput"
|
||||
- name: getDocument
|
||||
description: Get a document by ID
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/GetDocumentInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/GetDocumentOutput"
|
||||
- name: addDocument
|
||||
description: Add a new document to the organization
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/AddDocumentInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/AddDocumentOutput"
|
||||
- name: updateDocument
|
||||
description: Update an existing document
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/UpdateDocumentInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/UpdateDocumentOutput"
|
||||
- name: listDocumentVersions
|
||||
description: List all versions for a document
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/ListDocumentVersionsInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/ListDocumentVersionsOutput"
|
||||
- name: getDocumentVersion
|
||||
description: Get a document version by ID
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/GetDocumentVersionInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/GetDocumentVersionOutput"
|
||||
- name: createDraftDocumentVersion
|
||||
description: Create a new draft version from the latest published version
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/CreateDraftDocumentVersionInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/CreateDraftDocumentVersionOutput"
|
||||
- name: updateDocumentVersion
|
||||
description: Update an existing draft document version content
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/UpdateDocumentVersionInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/UpdateDocumentVersionOutput"
|
||||
- name: deleteDraftDocumentVersion
|
||||
description: Delete a draft document version
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/DeleteDraftDocumentVersionInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/DeleteDraftDocumentVersionOutput"
|
||||
- name: publishDocumentVersion
|
||||
description: Publish a draft document version
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/PublishDocumentVersionInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/PublishDocumentVersionOutput"
|
||||
- name: deleteDocument
|
||||
description: Delete a document
|
||||
hints:
|
||||
readonly: false
|
||||
destructive: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/DeleteDocumentInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/DeleteDocumentOutput"
|
||||
- name: listDocumentVersionSignatures
|
||||
description: List all signatures for a document version
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/ListDocumentVersionSignaturesInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/ListDocumentVersionSignaturesOutput"
|
||||
- name: getDocumentVersionSignature
|
||||
description: Get a document version signature by ID
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/GetDocumentVersionSignatureInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/GetDocumentVersionSignatureOutput"
|
||||
- name: requestDocumentVersionSignature
|
||||
description: Request a signature for a document version
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/RequestDocumentVersionSignatureInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/RequestDocumentVersionSignatureOutput"
|
||||
- name: cancelSignatureRequest
|
||||
description: Cancel a document version signature request
|
||||
hints:
|
||||
readonly: false
|
||||
destructive: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/CancelSignatureRequestInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/CancelSignatureRequestOutput"
|
||||
|
||||
128
pkg/server/api/mcp/v1/types/document.go
Normal file
128
pkg/server/api/mcp/v1/types/document.go
Normal file
@@ -0,0 +1,128 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// 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 NewDocument(d *coredata.Document) *Document {
|
||||
return &Document{
|
||||
ID: d.ID,
|
||||
OrganizationID: d.OrganizationID,
|
||||
OwnerID: d.OwnerID,
|
||||
Title: d.Title,
|
||||
DocumentType: d.DocumentType,
|
||||
Classification: d.Classification,
|
||||
CurrentPublishedVersion: d.CurrentPublishedVersion,
|
||||
TrustCenterVisibility: d.TrustCenterVisibility,
|
||||
CreatedAt: d.CreatedAt,
|
||||
UpdatedAt: d.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewListDocumentsOutput(documentPage *page.Page[*coredata.Document, coredata.DocumentOrderField]) ListDocumentsOutput {
|
||||
documents := make([]*Document, 0, len(documentPage.Data))
|
||||
for _, d := range documentPage.Data {
|
||||
documents = append(documents, NewDocument(d))
|
||||
}
|
||||
|
||||
var nextCursor *page.CursorKey
|
||||
if len(documentPage.Data) > 0 {
|
||||
cursorKey := documentPage.Data[len(documentPage.Data)-1].CursorKey(documentPage.Cursor.OrderBy.Field)
|
||||
nextCursor = &cursorKey
|
||||
}
|
||||
|
||||
return ListDocumentsOutput{
|
||||
NextCursor: nextCursor,
|
||||
Documents: documents,
|
||||
}
|
||||
}
|
||||
|
||||
func NewAddDocumentOutput(doc *coredata.Document, docVersion *coredata.DocumentVersion) AddDocumentOutput {
|
||||
return AddDocumentOutput{
|
||||
Document: NewDocument(doc),
|
||||
DocumentVersion: NewDocumentVersion(docVersion),
|
||||
}
|
||||
}
|
||||
|
||||
func NewDocumentVersion(dv *coredata.DocumentVersion) *DocumentVersion {
|
||||
return &DocumentVersion{
|
||||
ID: dv.ID,
|
||||
OrganizationID: dv.OrganizationID,
|
||||
DocumentID: dv.DocumentID,
|
||||
Title: dv.Title,
|
||||
OwnerID: dv.OwnerID,
|
||||
VersionNumber: dv.VersionNumber,
|
||||
Classification: dv.Classification,
|
||||
Content: dv.Content,
|
||||
Changelog: dv.Changelog,
|
||||
Status: dv.Status,
|
||||
PublishedAt: dv.PublishedAt,
|
||||
CreatedAt: dv.CreatedAt,
|
||||
UpdatedAt: dv.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewListDocumentVersionsOutput(versionPage *page.Page[*coredata.DocumentVersion, coredata.DocumentVersionOrderField]) ListDocumentVersionsOutput {
|
||||
versions := make([]*DocumentVersion, 0, len(versionPage.Data))
|
||||
for _, v := range versionPage.Data {
|
||||
versions = append(versions, NewDocumentVersion(v))
|
||||
}
|
||||
|
||||
var nextCursor *page.CursorKey
|
||||
if len(versionPage.Data) > 0 {
|
||||
cursorKey := versionPage.Data[len(versionPage.Data)-1].CursorKey(versionPage.Cursor.OrderBy.Field)
|
||||
nextCursor = &cursorKey
|
||||
}
|
||||
|
||||
return ListDocumentVersionsOutput{
|
||||
NextCursor: nextCursor,
|
||||
DocumentVersions: versions,
|
||||
}
|
||||
}
|
||||
|
||||
func NewDocumentVersionSignature(dvs *coredata.DocumentVersionSignature) *DocumentVersionSignature {
|
||||
return &DocumentVersionSignature{
|
||||
ID: dvs.ID,
|
||||
OrganizationID: dvs.OrganizationID,
|
||||
DocumentVersionID: dvs.DocumentVersionID,
|
||||
State: dvs.State,
|
||||
SignedBy: dvs.SignedBy,
|
||||
SignedAt: dvs.SignedAt,
|
||||
RequestedAt: dvs.RequestedAt,
|
||||
CreatedAt: dvs.CreatedAt,
|
||||
UpdatedAt: dvs.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewListDocumentVersionSignaturesOutput(signaturePage *page.Page[*coredata.DocumentVersionSignature, coredata.DocumentVersionSignatureOrderField]) ListDocumentVersionSignaturesOutput {
|
||||
signatures := make([]*DocumentVersionSignature, 0, len(signaturePage.Data))
|
||||
for _, s := range signaturePage.Data {
|
||||
signatures = append(signatures, NewDocumentVersionSignature(s))
|
||||
}
|
||||
|
||||
var nextCursor *page.CursorKey
|
||||
if len(signaturePage.Data) > 0 {
|
||||
cursorKey := signaturePage.Data[len(signaturePage.Data)-1].CursorKey(signaturePage.Cursor.OrderBy.Field)
|
||||
nextCursor = &cursorKey
|
||||
}
|
||||
|
||||
return ListDocumentVersionSignaturesOutput{
|
||||
NextCursor: nextCursor,
|
||||
DocumentVersionSignatures: signatures,
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,8 @@ var (
|
||||
AddControlToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["control"],"properties":{"control":{"type":"object","required":["id","organization_id","framework_id","section_title","name","status","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Control description"},"exclusion_justification":{"description":"Exclusion justification"},"framework_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Control name"},"organization_id":{"type":"string","format":"string"},"section_title":{"type":"string","description":"Section title"},"status":{"type":"string","enum":["INCLUDED","EXCLUDED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
AddDatumToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id","name","data_classification","owner_id"],"properties":{"data_classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"name":{"type":"string","description":"Datum name"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"vendor_ids":{"type":"array","description":"Vendor IDs","items":{"type":"string","format":"string"}}}}`)
|
||||
AddDatumToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","required":["id","organization_id","name","data_classification","owner_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"data_classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Datum name"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
AddDocumentToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id","title","content","owner_id","classification","document_type"],"properties":{"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"content":{"type":"string","description":"Document content"},"document_type":{"type":"string","enum":["OTHER","ISMS","POLICY","PROCEDURE"]},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"title":{"type":"string","description":"Document title"},"trust_center_visibility":{"type":"string","enum":["NONE","PRIVATE","PUBLIC"]}}}`)
|
||||
AddDocumentToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document","document_version"],"properties":{"document":{"type":"object","required":["id","organization_id","owner_id","title","document_type","classification","trust_center_visibility","created_at","updated_at"],"properties":{"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"current_published_version":{"description":"Current published version number"},"document_type":{"type":"string","enum":["OTHER","ISMS","POLICY","PROCEDURE"]},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"title":{"type":"string","description":"Document title"},"trust_center_visibility":{"type":"string","enum":["NONE","PRIVATE","PUBLIC"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}},"document_version":{"type":"object","required":["id","organization_id","document_id","title","owner_id","version_number","classification","content","changelog","status","created_at","updated_at"],"properties":{"changelog":{"type":"string","description":"Changelog"},"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"content":{"type":"string","description":"Document content"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"published_at":{"description":"Published timestamp","format":"date-time"},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"title":{"type":"string","description":"Document version title"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"},"version_number":{"type":"integer","description":"Version number"}}}}}`)
|
||||
AddFrameworkToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id","name"],"properties":{"description":{"type":"string","description":"Framework description"},"name":{"type":"string","description":"Framework name"},"organization_id":{"type":"string","format":"string"}}}`)
|
||||
AddFrameworkToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["framework"],"properties":{"framework":{"type":"object","required":["id","organization_id","name","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Framework description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Framework name"},"organization_id":{"type":"string","format":"string"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
AddMeasureToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id","name","category"],"properties":{"category":{"type":"string","description":"Measure category"},"description":{"type":"string","description":"Measure description"},"name":{"type":"string","description":"Measure name"},"organization_id":{"type":"string","format":"string"}}}`)
|
||||
@@ -40,6 +42,14 @@ var (
|
||||
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"}}}}}`)
|
||||
CancelSignatureRequestToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version_signature_id"],"properties":{"document_version_signature_id":{"type":"string","format":"string"}}}`)
|
||||
CancelSignatureRequestToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["deleted_document_version_signature_id"],"properties":{"deleted_document_version_signature_id":{"type":"string","format":"string"}}}`)
|
||||
CreateDraftDocumentVersionToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_id"],"properties":{"document_id":{"type":"string","format":"string"}}}`)
|
||||
CreateDraftDocumentVersionToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version"],"properties":{"document_version":{"type":"object","required":["id","organization_id","document_id","title","owner_id","version_number","classification","content","changelog","status","created_at","updated_at"],"properties":{"changelog":{"type":"string","description":"Changelog"},"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"content":{"type":"string","description":"Document content"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"published_at":{"description":"Published timestamp","format":"date-time"},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"title":{"type":"string","description":"Document version title"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"},"version_number":{"type":"integer","description":"Version number"}}}}}`)
|
||||
DeleteDocumentToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_id"],"properties":{"document_id":{"type":"string","format":"string"}}}`)
|
||||
DeleteDocumentToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["deleted_document_id"],"properties":{"deleted_document_id":{"type":"string","format":"string"}}}`)
|
||||
DeleteDraftDocumentVersionToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version_id"],"properties":{"document_version_id":{"type":"string","format":"string"}}}`)
|
||||
DeleteDraftDocumentVersionToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["deleted_document_version_id"],"properties":{"deleted_document_version_id":{"type":"string","format":"string"}}}`)
|
||||
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"}}}`)
|
||||
@@ -50,6 +60,12 @@ var (
|
||||
GetControlToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["control"],"properties":{"control":{"type":"object","required":["id","organization_id","framework_id","section_title","name","status","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Control description"},"exclusion_justification":{"description":"Exclusion justification"},"framework_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Control name"},"organization_id":{"type":"string","format":"string"},"section_title":{"type":"string","description":"Section title"},"status":{"type":"string","enum":["INCLUDED","EXCLUDED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
GetDatumToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`)
|
||||
GetDatumToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","required":["id","organization_id","name","data_classification","owner_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"data_classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Datum name"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
GetDocumentToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`)
|
||||
GetDocumentToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document"],"properties":{"document":{"type":"object","required":["id","organization_id","owner_id","title","document_type","classification","trust_center_visibility","created_at","updated_at"],"properties":{"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"current_published_version":{"description":"Current published version number"},"document_type":{"type":"string","enum":["OTHER","ISMS","POLICY","PROCEDURE"]},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"title":{"type":"string","description":"Document title"},"trust_center_visibility":{"type":"string","enum":["NONE","PRIVATE","PUBLIC"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
GetDocumentVersionSignatureToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`)
|
||||
GetDocumentVersionSignatureToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version_signature"],"properties":{"document_version_signature":{"type":"object","required":["id","organization_id","document_version_id","state","signed_by","requested_at","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_version_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"requested_at":{"type":"string","description":"Requested timestamp","format":"date-time"},"signed_at":{"description":"Signed timestamp","format":"date-time"},"signed_by":{"type":"string","format":"string"},"state":{"type":"string","enum":["REQUESTED","SIGNED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
GetDocumentVersionToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`)
|
||||
GetDocumentVersionToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version"],"properties":{"document_version":{"type":"object","required":["id","organization_id","document_id","title","owner_id","version_number","classification","content","changelog","status","created_at","updated_at"],"properties":{"changelog":{"type":"string","description":"Changelog"},"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"content":{"type":"string","description":"Document content"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"published_at":{"description":"Published timestamp","format":"date-time"},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"title":{"type":"string","description":"Document version title"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"},"version_number":{"type":"integer","description":"Version number"}}}}}`)
|
||||
GetFrameworkToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`)
|
||||
GetFrameworkToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["framework"],"properties":{"framework":{"type":"object","required":["id","organization_id","name","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Framework description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Framework name"},"organization_id":{"type":"string","format":"string"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
GetMeasureToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`)
|
||||
@@ -84,6 +100,12 @@ var (
|
||||
ListControlsToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["controls"],"properties":{"controls":{"type":"array","items":{"type":"object","required":["id","organization_id","framework_id","section_title","name","status","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Control description"},"exclusion_justification":{"description":"Exclusion justification"},"framework_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Control name"},"organization_id":{"type":"string","format":"string"},"section_title":{"type":"string","description":"Section title"},"status":{"type":"string","enum":["INCLUDED","EXCLUDED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}},"next_cursor":{"type":"string","format":"string"}}}`)
|
||||
ListDataToolInputSchema = 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","NAME","DATA_CLASSIFICATION"]}}},"organization_id":{"type":"string","format":"string"},"size":{"type":"integer","description":"Page size"}}}`)
|
||||
ListDataToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","organization_id","name","data_classification","owner_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"data_classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Datum name"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}},"next_cursor":{"type":"string","format":"string"}}}`)
|
||||
ListDocumentVersionSignaturesToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version_id"],"properties":{"cursor":{"type":"string","format":"string"},"document_version_id":{"type":"string","format":"string"},"filter":{"type":"object","properties":{"states":{"type":"array","description":"Signature states","items":{"type":"string","enum":["REQUESTED","SIGNED"]}}}},"order_by":{"type":"object","required":["field","direction"],"properties":{"direction":{"type":"string","enum":["ASC","DESC"]},"field":{"type":"string","enum":["CREATED_AT","SIGNED_AT"]}}},"size":{"type":"integer","description":"Page size"}}}`)
|
||||
ListDocumentVersionSignaturesToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version_signatures"],"properties":{"document_version_signatures":{"type":"array","items":{"type":"object","required":["id","organization_id","document_version_id","state","signed_by","requested_at","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_version_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"requested_at":{"type":"string","description":"Requested timestamp","format":"date-time"},"signed_at":{"description":"Signed timestamp","format":"date-time"},"signed_by":{"type":"string","format":"string"},"state":{"type":"string","enum":["REQUESTED","SIGNED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}},"next_cursor":{"type":"string","format":"string"}}}`)
|
||||
ListDocumentVersionsToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_id"],"properties":{"cursor":{"type":"string","format":"string"},"document_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","VERSION"]}}},"size":{"type":"integer","description":"Page size"}}}`)
|
||||
ListDocumentVersionsToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_versions"],"properties":{"document_versions":{"type":"array","items":{"type":"object","required":["id","organization_id","document_id","title","owner_id","version_number","classification","content","changelog","status","created_at","updated_at"],"properties":{"changelog":{"type":"string","description":"Changelog"},"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"content":{"type":"string","description":"Document content"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"published_at":{"description":"Published timestamp","format":"date-time"},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"title":{"type":"string","description":"Document version title"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"},"version_number":{"type":"integer","description":"Version number"}}}},"next_cursor":{"type":"string","format":"string"}}}`)
|
||||
ListDocumentsToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id"],"properties":{"cursor":{"type":"string","format":"string"},"filter":{"type":"object","properties":{"query":{"type":"string","description":"Search query"},"trust_center_visibilities":{"type":"array","description":"Trust center visibilities","items":{"type":"string","enum":["NONE","PRIVATE","PUBLIC"]}}}},"order_by":{"type":"object","required":["field","direction"],"properties":{"direction":{"type":"string","enum":["ASC","DESC"]},"field":{"type":"string","enum":["CREATED_AT","TITLE","DOCUMENT_TYPE"]}}},"organization_id":{"type":"string","format":"string"},"size":{"type":"integer","description":"Page size"}}}`)
|
||||
ListDocumentsToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["documents"],"properties":{"documents":{"type":"array","items":{"type":"object","required":["id","organization_id","owner_id","title","document_type","classification","trust_center_visibility","created_at","updated_at"],"properties":{"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"current_published_version":{"description":"Current published version number"},"document_type":{"type":"string","enum":["OTHER","ISMS","POLICY","PROCEDURE"]},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"title":{"type":"string","description":"Document title"},"trust_center_visibility":{"type":"string","enum":["NONE","PRIVATE","PUBLIC"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}},"next_cursor":{"type":"string","format":"string"}}}`)
|
||||
ListFrameworksToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id"],"properties":{"cursor":{"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"}}}`)
|
||||
ListFrameworksToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["frameworks"],"properties":{"frameworks":{"type":"array","items":{"type":"object","required":["id","organization_id","name","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Framework description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Framework name"},"organization_id":{"type":"string","format":"string"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}},"next_cursor":{"type":"string","format":"string"}}}`)
|
||||
ListMeasuresToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id"],"properties":{"cursor":{"type":"string","format":"string"},"filter":{"type":"object","properties":{"query":{"type":"string","description":"Search query"},"state":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","NOT_APPLICABLE","IMPLEMENTED"]}}},"order_by":{"type":"object","required":["field","direction"],"properties":{"direction":{"type":"string","enum":["ASC","DESC"]},"field":{"type":"string","enum":["CREATED_AT","NAME"]}}},"organization_id":{"type":"string","format":"string"},"size":{"type":"integer","description":"Page size"}}}`)
|
||||
@@ -104,6 +126,10 @@ var (
|
||||
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"}}}}}}`)
|
||||
PublishDocumentVersionToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_id"],"properties":{"changelog":{"type":"string","description":"Changelog"},"document_id":{"type":"string","format":"string"}}}`)
|
||||
PublishDocumentVersionToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document","document_version"],"properties":{"document":{"type":"object","required":["id","organization_id","owner_id","title","document_type","classification","trust_center_visibility","created_at","updated_at"],"properties":{"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"current_published_version":{"description":"Current published version number"},"document_type":{"type":"string","enum":["OTHER","ISMS","POLICY","PROCEDURE"]},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"title":{"type":"string","description":"Document title"},"trust_center_visibility":{"type":"string","enum":["NONE","PRIVATE","PUBLIC"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}},"document_version":{"type":"object","required":["id","organization_id","document_id","title","owner_id","version_number","classification","content","changelog","status","created_at","updated_at"],"properties":{"changelog":{"type":"string","description":"Changelog"},"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"content":{"type":"string","description":"Document content"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"published_at":{"description":"Published timestamp","format":"date-time"},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"title":{"type":"string","description":"Document version title"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"},"version_number":{"type":"integer","description":"Version number"}}}}}`)
|
||||
RequestDocumentVersionSignatureToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version_id","signatory_id"],"properties":{"document_version_id":{"type":"string","format":"string"},"signatory_id":{"type":"string","format":"string"}}}`)
|
||||
RequestDocumentVersionSignatureToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version_signature"],"properties":{"document_version_signature":{"type":"object","required":["id","organization_id","document_version_id","state","signed_by","requested_at","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_version_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"requested_at":{"type":"string","description":"Requested timestamp","format":"date-time"},"signed_at":{"description":"Signed timestamp","format":"date-time"},"signed_by":{"type":"string","format":"string"},"state":{"type":"string","enum":["REQUESTED","SIGNED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
TakeSnapshotToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["organization_id","name","type"],"properties":{"description":{"type":"string","description":"Snapshot description"},"name":{"type":"string","description":"Snapshot name"},"organization_id":{"type":"string","format":"string"},"type":{"type":"string","enum":["RISKS","VENDORS","ASSETS","DATA","NONCONFORMITIES","OBLIGATIONS","CONTINUAL_IMPROVEMENTS","PROCESSING_ACTIVITIES"]}}}`)
|
||||
TakeSnapshotToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["snapshot"],"properties":{"snapshot":{"type":"object","required":["id","organization_id","name","type","created_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Snapshot description","anyOf":[{"type":"string","description":"Snapshot description"},{"type":"null","description":"No description"}]},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Snapshot name"},"organization_id":{"type":"string","format":"string"},"type":{"type":"string","enum":["RISKS","VENDORS","ASSETS","DATA","NONCONFORMITIES","OBLIGATIONS","CONTINUAL_IMPROVEMENTS","PROCESSING_ACTIVITIES"]}}}}}`)
|
||||
UnassignTaskToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"string"}}}`)
|
||||
@@ -126,6 +152,10 @@ var (
|
||||
UpdateControlToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["control"],"properties":{"control":{"type":"object","required":["id","organization_id","framework_id","section_title","name","status","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Control description"},"exclusion_justification":{"description":"Exclusion justification"},"framework_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Control name"},"organization_id":{"type":"string","format":"string"},"section_title":{"type":"string","description":"Section title"},"status":{"type":"string","enum":["INCLUDED","EXCLUDED"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
UpdateDatumToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"data_classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Datum name"},"owner_id":{"description":"Owner ID","anyOf":[{"type":"string","format":"string"},{"type":"null"}]},"vendor_ids":{"type":"array","description":"Vendor IDs","items":{"type":"string","format":"string"}}}}`)
|
||||
UpdateDatumToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","required":["id","organization_id","name","data_classification","owner_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"data_classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Datum name"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"snapshot_id":{"description":"Snapshot ID","anyOf":[{"type":"string","format":"string"},{"type":"null","description":"No snapshot"}]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
UpdateDocumentToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"document_type":{"type":"string","enum":["OTHER","ISMS","POLICY","PROCEDURE"]},"id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"title":{"type":"string","description":"Document title"},"trust_center_visibility":{"type":"string","enum":["NONE","PRIVATE","PUBLIC"]}}}`)
|
||||
UpdateDocumentToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document"],"properties":{"document":{"type":"object","required":["id","organization_id","owner_id","title","document_type","classification","trust_center_visibility","created_at","updated_at"],"properties":{"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"current_published_version":{"description":"Current published version number"},"document_type":{"type":"string","enum":["OTHER","ISMS","POLICY","PROCEDURE"]},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"title":{"type":"string","description":"Document title"},"trust_center_visibility":{"type":"string","enum":["NONE","PRIVATE","PUBLIC"]},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
UpdateDocumentVersionToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version_id","content"],"properties":{"content":{"type":"string","description":"Document content"},"document_version_id":{"type":"string","format":"string"}}}`)
|
||||
UpdateDocumentVersionToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["document_version"],"properties":{"document_version":{"type":"object","required":["id","organization_id","document_id","title","owner_id","version_number","classification","content","changelog","status","created_at","updated_at"],"properties":{"changelog":{"type":"string","description":"Changelog"},"classification":{"type":"string","enum":["PUBLIC","INTERNAL","CONFIDENTIAL","SECRET"]},"content":{"type":"string","description":"Document content"},"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"document_id":{"type":"string","format":"string"},"id":{"type":"string","format":"string"},"organization_id":{"type":"string","format":"string"},"owner_id":{"type":"string","format":"string"},"published_at":{"description":"Published timestamp","format":"date-time"},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"title":{"type":"string","description":"Document version title"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"},"version_number":{"type":"integer","description":"Version number"}}}}}`)
|
||||
UpdateFrameworkToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"description":{"description":"Framework description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Framework name"}}}`)
|
||||
UpdateFrameworkToolOutputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["framework"],"properties":{"framework":{"type":"object","required":["id","organization_id","name","created_at","updated_at"],"properties":{"created_at":{"type":"string","description":"Creation timestamp","format":"date-time"},"description":{"description":"Framework description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Framework name"},"organization_id":{"type":"string","format":"string"},"updated_at":{"type":"string","description":"Update timestamp","format":"date-time"}}}}}`)
|
||||
UpdateMeasureToolInputSchema = mcp.MustUnmarshalSchema(`{"type":"object","required":["id"],"properties":{"category":{"type":"string","description":"Measure category"},"description":{"description":"Measure description"},"id":{"type":"string","format":"string"},"name":{"type":"string","description":"Measure name"},"state":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","NOT_APPLICABLE","IMPLEMENTED"]}}}`)
|
||||
@@ -253,6 +283,30 @@ type AddDatumOutput struct {
|
||||
Datum *Datum `json:"datum"`
|
||||
}
|
||||
|
||||
// AddDocumentInput represents the schema
|
||||
type AddDocumentInput struct {
|
||||
// Document classification
|
||||
Classification coredata.DocumentClassification `json:"classification"`
|
||||
// Document content
|
||||
Content string `json:"content"`
|
||||
// Document type
|
||||
DocumentType coredata.DocumentType `json:"document_type"`
|
||||
// Organization ID
|
||||
OrganizationID gid.GID `json:"organization_id"`
|
||||
// Owner ID
|
||||
OwnerID gid.GID `json:"owner_id"`
|
||||
// Document title
|
||||
Title string `json:"title"`
|
||||
// Trust center visibility
|
||||
TrustCenterVisibility *coredata.TrustCenterVisibility `json:"trust_center_visibility,omitempty"`
|
||||
}
|
||||
|
||||
// AddDocumentOutput represents the schema
|
||||
type AddDocumentOutput struct {
|
||||
Document *Document `json:"document"`
|
||||
DocumentVersion *DocumentVersion `json:"document_version"`
|
||||
}
|
||||
|
||||
// AddFrameworkInput represents the schema
|
||||
type AddFrameworkInput struct {
|
||||
// Framework description
|
||||
@@ -520,6 +574,18 @@ type AuditOrderBy struct {
|
||||
Field coredata.AuditOrderField `json:"field"`
|
||||
}
|
||||
|
||||
// CancelSignatureRequestInput represents the schema
|
||||
type CancelSignatureRequestInput struct {
|
||||
// Document version signature ID
|
||||
DocumentVersionSignatureID gid.GID `json:"document_version_signature_id"`
|
||||
}
|
||||
|
||||
// CancelSignatureRequestOutput represents the schema
|
||||
type CancelSignatureRequestOutput struct {
|
||||
// Deleted document version signature ID
|
||||
DeletedDocumentVersionSignatureID gid.GID `json:"deleted_document_version_signature_id"`
|
||||
}
|
||||
|
||||
// ContinualImprovement represents the schema
|
||||
type ContinualImprovement struct {
|
||||
// Creation timestamp
|
||||
@@ -590,6 +656,17 @@ type ControlOrderBy struct {
|
||||
Field coredata.ControlOrderField `json:"field"`
|
||||
}
|
||||
|
||||
// CreateDraftDocumentVersionInput represents the schema
|
||||
type CreateDraftDocumentVersionInput struct {
|
||||
// Document ID
|
||||
DocumentID gid.GID `json:"document_id"`
|
||||
}
|
||||
|
||||
// CreateDraftDocumentVersionOutput represents the schema
|
||||
type CreateDraftDocumentVersionOutput struct {
|
||||
DocumentVersion *DocumentVersion `json:"document_version"`
|
||||
}
|
||||
|
||||
// Datum represents the schema
|
||||
type Datum struct {
|
||||
// Creation timestamp
|
||||
@@ -618,6 +695,130 @@ type DatumOrderBy struct {
|
||||
Field coredata.DatumOrderField `json:"field"`
|
||||
}
|
||||
|
||||
// DeleteDocumentInput represents the schema
|
||||
type DeleteDocumentInput struct {
|
||||
// Document ID
|
||||
DocumentID gid.GID `json:"document_id"`
|
||||
}
|
||||
|
||||
// DeleteDocumentOutput represents the schema
|
||||
type DeleteDocumentOutput struct {
|
||||
// Deleted document ID
|
||||
DeletedDocumentID gid.GID `json:"deleted_document_id"`
|
||||
}
|
||||
|
||||
// DeleteDraftDocumentVersionInput represents the schema
|
||||
type DeleteDraftDocumentVersionInput struct {
|
||||
// Document version ID
|
||||
DocumentVersionID gid.GID `json:"document_version_id"`
|
||||
}
|
||||
|
||||
// DeleteDraftDocumentVersionOutput represents the schema
|
||||
type DeleteDraftDocumentVersionOutput struct {
|
||||
// Deleted document version ID
|
||||
DeletedDocumentVersionID gid.GID `json:"deleted_document_version_id"`
|
||||
}
|
||||
|
||||
// Document represents the schema
|
||||
type Document struct {
|
||||
// Document classification
|
||||
Classification coredata.DocumentClassification `json:"classification"`
|
||||
// Creation timestamp
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// Current published version number
|
||||
CurrentPublishedVersion *int `json:"current_published_version,omitempty"`
|
||||
// Document type
|
||||
DocumentType coredata.DocumentType `json:"document_type"`
|
||||
// Document ID
|
||||
ID gid.GID `json:"id"`
|
||||
// Organization ID
|
||||
OrganizationID gid.GID `json:"organization_id"`
|
||||
// Owner ID
|
||||
OwnerID gid.GID `json:"owner_id"`
|
||||
// Document title
|
||||
Title string `json:"title"`
|
||||
// Trust center visibility
|
||||
TrustCenterVisibility coredata.TrustCenterVisibility `json:"trust_center_visibility"`
|
||||
// Update timestamp
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// DocumentOrderBy represents the schema
|
||||
type DocumentOrderBy struct {
|
||||
// Document order direction
|
||||
Direction page.OrderDirection `json:"direction"`
|
||||
// Document order field
|
||||
Field coredata.DocumentOrderField `json:"field"`
|
||||
}
|
||||
|
||||
// DocumentVersion represents the schema
|
||||
type DocumentVersion struct {
|
||||
// Changelog
|
||||
Changelog string `json:"changelog"`
|
||||
// Document classification
|
||||
Classification coredata.DocumentClassification `json:"classification"`
|
||||
// Document content
|
||||
Content string `json:"content"`
|
||||
// Creation timestamp
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// Document ID
|
||||
DocumentID gid.GID `json:"document_id"`
|
||||
// Document version ID
|
||||
ID gid.GID `json:"id"`
|
||||
// Organization ID
|
||||
OrganizationID gid.GID `json:"organization_id"`
|
||||
// Owner ID
|
||||
OwnerID gid.GID `json:"owner_id"`
|
||||
// Published timestamp
|
||||
PublishedAt *time.Time `json:"published_at,omitempty"`
|
||||
// Document status
|
||||
Status coredata.DocumentStatus `json:"status"`
|
||||
// Document version title
|
||||
Title string `json:"title"`
|
||||
// Update timestamp
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
// Version number
|
||||
VersionNumber int `json:"version_number"`
|
||||
}
|
||||
|
||||
// DocumentVersionOrderBy represents the schema
|
||||
type DocumentVersionOrderBy struct {
|
||||
// Document version order direction
|
||||
Direction page.OrderDirection `json:"direction"`
|
||||
// Document version order field
|
||||
Field coredata.DocumentVersionOrderField `json:"field"`
|
||||
}
|
||||
|
||||
// DocumentVersionSignature represents the schema
|
||||
type DocumentVersionSignature struct {
|
||||
// Creation timestamp
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// Document version ID
|
||||
DocumentVersionID gid.GID `json:"document_version_id"`
|
||||
// Document version signature ID
|
||||
ID gid.GID `json:"id"`
|
||||
// Organization ID
|
||||
OrganizationID gid.GID `json:"organization_id"`
|
||||
// Requested timestamp
|
||||
RequestedAt time.Time `json:"requested_at"`
|
||||
// Signed timestamp
|
||||
SignedAt *time.Time `json:"signed_at,omitempty"`
|
||||
// Signatory ID
|
||||
SignedBy gid.GID `json:"signed_by"`
|
||||
// Signature state
|
||||
State coredata.DocumentVersionSignatureState `json:"state"`
|
||||
// Update timestamp
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// DocumentVersionSignatureOrderBy represents the schema
|
||||
type DocumentVersionSignatureOrderBy struct {
|
||||
// Document version signature order direction
|
||||
Direction page.OrderDirection `json:"direction"`
|
||||
// Document version signature order field
|
||||
Field coredata.DocumentVersionSignatureOrderField `json:"field"`
|
||||
}
|
||||
|
||||
// Framework represents the schema
|
||||
type Framework struct {
|
||||
// Creation timestamp
|
||||
@@ -697,6 +898,39 @@ type GetDatumOutput struct {
|
||||
Datum *Datum `json:"datum"`
|
||||
}
|
||||
|
||||
// GetDocumentInput represents the schema
|
||||
type GetDocumentInput struct {
|
||||
// Document ID
|
||||
ID gid.GID `json:"id"`
|
||||
}
|
||||
|
||||
// GetDocumentOutput represents the schema
|
||||
type GetDocumentOutput struct {
|
||||
Document *Document `json:"document"`
|
||||
}
|
||||
|
||||
// GetDocumentVersionInput represents the schema
|
||||
type GetDocumentVersionInput struct {
|
||||
// Document version ID
|
||||
ID gid.GID `json:"id"`
|
||||
}
|
||||
|
||||
// GetDocumentVersionOutput represents the schema
|
||||
type GetDocumentVersionOutput struct {
|
||||
DocumentVersion *DocumentVersion `json:"document_version"`
|
||||
}
|
||||
|
||||
// GetDocumentVersionSignatureInput represents the schema
|
||||
type GetDocumentVersionSignatureInput struct {
|
||||
// Document version signature ID
|
||||
ID gid.GID `json:"id"`
|
||||
}
|
||||
|
||||
// GetDocumentVersionSignatureOutput represents the schema
|
||||
type GetDocumentVersionSignatureOutput struct {
|
||||
DocumentVersionSignature *DocumentVersionSignature `json:"document_version_signature"`
|
||||
}
|
||||
|
||||
// GetFrameworkInput represents the schema
|
||||
type GetFrameworkInput struct {
|
||||
// Framework ID
|
||||
@@ -934,6 +1168,65 @@ type ListDataOutput struct {
|
||||
NextCursor *page.CursorKey `json:"next_cursor,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocumentVersionSignaturesInput represents the schema
|
||||
type ListDocumentVersionSignaturesInput struct {
|
||||
// Page cursor
|
||||
Cursor *page.CursorKey `json:"cursor,omitempty"`
|
||||
// Document version ID
|
||||
DocumentVersionID gid.GID `json:"document_version_id"`
|
||||
Filter *ListDocumentVersionSignaturesInputFilter `json:"filter,omitempty"`
|
||||
// Document version signature order by
|
||||
OrderBy *DocumentVersionSignatureOrderBy `json:"order_by,omitempty"`
|
||||
// Page size
|
||||
Size *int `json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocumentVersionSignaturesOutput represents the schema
|
||||
type ListDocumentVersionSignaturesOutput struct {
|
||||
DocumentVersionSignatures []*DocumentVersionSignature `json:"document_version_signatures"`
|
||||
// Next cursor
|
||||
NextCursor *page.CursorKey `json:"next_cursor,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocumentVersionsInput represents the schema
|
||||
type ListDocumentVersionsInput struct {
|
||||
// Page cursor
|
||||
Cursor *page.CursorKey `json:"cursor,omitempty"`
|
||||
// Document ID
|
||||
DocumentID gid.GID `json:"document_id"`
|
||||
// Document version order by
|
||||
OrderBy *DocumentVersionOrderBy `json:"order_by,omitempty"`
|
||||
// Page size
|
||||
Size *int `json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocumentVersionsOutput represents the schema
|
||||
type ListDocumentVersionsOutput struct {
|
||||
DocumentVersions []*DocumentVersion `json:"document_versions"`
|
||||
// Next cursor
|
||||
NextCursor *page.CursorKey `json:"next_cursor,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocumentsInput represents the schema
|
||||
type ListDocumentsInput struct {
|
||||
// Page cursor
|
||||
Cursor *page.CursorKey `json:"cursor,omitempty"`
|
||||
Filter *ListDocumentsInputFilter `json:"filter,omitempty"`
|
||||
// Document order by
|
||||
OrderBy *DocumentOrderBy `json:"order_by,omitempty"`
|
||||
// Organization ID
|
||||
OrganizationID gid.GID `json:"organization_id"`
|
||||
// Page size
|
||||
Size *int `json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocumentsOutput represents the schema
|
||||
type ListDocumentsOutput struct {
|
||||
Documents []*Document `json:"documents"`
|
||||
// Next cursor
|
||||
NextCursor *page.CursorKey `json:"next_cursor,omitempty"`
|
||||
}
|
||||
|
||||
// ListFrameworksInput represents the schema
|
||||
type ListFrameworksInput struct {
|
||||
// Page cursor
|
||||
@@ -1284,6 +1577,33 @@ type PeopleOrderBy struct {
|
||||
Field coredata.PeopleOrderField `json:"field"`
|
||||
}
|
||||
|
||||
// PublishDocumentVersionInput represents the schema
|
||||
type PublishDocumentVersionInput struct {
|
||||
// Changelog
|
||||
Changelog *string `json:"changelog,omitempty"`
|
||||
// Document ID
|
||||
DocumentID gid.GID `json:"document_id"`
|
||||
}
|
||||
|
||||
// PublishDocumentVersionOutput represents the schema
|
||||
type PublishDocumentVersionOutput struct {
|
||||
Document *Document `json:"document"`
|
||||
DocumentVersion *DocumentVersion `json:"document_version"`
|
||||
}
|
||||
|
||||
// RequestDocumentVersionSignatureInput represents the schema
|
||||
type RequestDocumentVersionSignatureInput struct {
|
||||
// Document version ID
|
||||
DocumentVersionID gid.GID `json:"document_version_id"`
|
||||
// Signatory ID (People ID)
|
||||
SignatoryID gid.GID `json:"signatory_id"`
|
||||
}
|
||||
|
||||
// RequestDocumentVersionSignatureOutput represents the schema
|
||||
type RequestDocumentVersionSignatureOutput struct {
|
||||
DocumentVersionSignature *DocumentVersionSignature `json:"document_version_signature"`
|
||||
}
|
||||
|
||||
// Risk represents the schema
|
||||
type Risk struct {
|
||||
// Risk category
|
||||
@@ -1572,6 +1892,40 @@ type UpdateDatumOutput struct {
|
||||
Datum *Datum `json:"datum"`
|
||||
}
|
||||
|
||||
// UpdateDocumentInput represents the schema
|
||||
type UpdateDocumentInput struct {
|
||||
// Document classification
|
||||
Classification *coredata.DocumentClassification `json:"classification,omitempty"`
|
||||
// Document type
|
||||
DocumentType *coredata.DocumentType `json:"document_type,omitempty"`
|
||||
// Document ID
|
||||
ID gid.GID `json:"id"`
|
||||
// Owner ID
|
||||
OwnerID *gid.GID `json:"owner_id,omitempty"`
|
||||
// Document title
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Trust center visibility
|
||||
TrustCenterVisibility *coredata.TrustCenterVisibility `json:"trust_center_visibility,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateDocumentOutput represents the schema
|
||||
type UpdateDocumentOutput struct {
|
||||
Document *Document `json:"document"`
|
||||
}
|
||||
|
||||
// UpdateDocumentVersionInput represents the schema
|
||||
type UpdateDocumentVersionInput struct {
|
||||
// Document content
|
||||
Content string `json:"content"`
|
||||
// Document version ID
|
||||
DocumentVersionID gid.GID `json:"document_version_id"`
|
||||
}
|
||||
|
||||
// UpdateDocumentVersionOutput represents the schema
|
||||
type UpdateDocumentVersionOutput struct {
|
||||
DocumentVersion *DocumentVersion `json:"document_version"`
|
||||
}
|
||||
|
||||
// UpdateFrameworkInput represents the schema
|
||||
type UpdateFrameworkInput struct {
|
||||
// Framework description
|
||||
@@ -1781,6 +2135,20 @@ type ListDataInputFilter struct {
|
||||
SnapshotID *gid.GID `json:"snapshot_id,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocumentVersionSignaturesInputFilter represents the schema
|
||||
type ListDocumentVersionSignaturesInputFilter struct {
|
||||
// Signature states
|
||||
States []coredata.DocumentVersionSignatureState `json:"states,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocumentsInputFilter represents the schema
|
||||
type ListDocumentsInputFilter struct {
|
||||
// Search query
|
||||
Query *string `json:"query,omitempty"`
|
||||
// Trust center visibilities
|
||||
TrustCenterVisibilities []coredata.TrustCenterVisibility `json:"trust_center_visibilities,omitempty"`
|
||||
}
|
||||
|
||||
// ListMeasuresInputFilter represents the schema
|
||||
type ListMeasuresInputFilter struct {
|
||||
// Search query
|
||||
|
||||
Reference in New Issue
Block a user