Add framework tools

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-11-23 21:08:55 +01:00
parent 963fbd8eab
commit 72a6d33535
5 changed files with 441 additions and 0 deletions

View File

@@ -25,6 +25,10 @@ type ResolverInterface interface {
GetMeasureTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetMeasureInput) (*mcp.CallToolResult, types.GetMeasureOutput, error)
AddMeasureTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddMeasureInput) (*mcp.CallToolResult, types.AddMeasureOutput, error)
UpdateMeasureTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateMeasureInput) (*mcp.CallToolResult, types.UpdateMeasureOutput, error)
ListFrameworksTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListFrameworksInput) (*mcp.CallToolResult, types.ListFrameworksOutput, error)
GetFrameworkTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetFrameworkInput) (*mcp.CallToolResult, types.GetFrameworkOutput, error)
AddFrameworkTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddFrameworkInput) (*mcp.CallToolResult, types.AddFrameworkOutput, error)
UpdateFrameworkTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateFrameworkInput) (*mcp.CallToolResult, types.UpdateFrameworkOutput, error)
}
// New creates a new MCP server instance with all handlers registered.
@@ -194,4 +198,44 @@ func registerToolHandlers(server *mcp.Server, resolver ResolverInterface) {
},
resolver.UpdateMeasureTool,
)
mcp.AddTool(
server,
&mcp.Tool{
Name: "listFrameworks",
Description: "List all frameworks for the organization",
InputSchema: types.ListFrameworksToolInputSchema,
OutputSchema: types.ListFrameworksToolOutputSchema,
},
resolver.ListFrameworksTool,
)
mcp.AddTool(
server,
&mcp.Tool{
Name: "getFramework",
Description: "Get a framework by ID",
InputSchema: types.GetFrameworkToolInputSchema,
OutputSchema: types.GetFrameworkToolOutputSchema,
},
resolver.GetFrameworkTool,
)
mcp.AddTool(
server,
&mcp.Tool{
Name: "addFramework",
Description: "Add a new framework to the organization",
InputSchema: types.AddFrameworkToolInputSchema,
OutputSchema: types.AddFrameworkToolOutputSchema,
},
resolver.AddFrameworkTool,
)
mcp.AddTool(
server,
&mcp.Tool{
Name: "updateFramework",
Description: "Update an existing framework",
InputSchema: types.UpdateFrameworkToolInputSchema,
OutputSchema: types.UpdateFrameworkToolOutputSchema,
},
resolver.UpdateFrameworkTool,
)
}