MCPcopy Create free account
hub / github.com/coder/coder / makeTool

Function makeTool

coderd/x/chatd/mcpclient/mcpclient_test.go:69–76  ·  view source on GitHub ↗

makeTool returns a ServerTool with the given name and a no-op handler that always returns "ok".

(name string)

Source from the content-addressed store, hash-verified

67// makeTool returns a ServerTool with the given name and a
68// no-op handler that always returns "ok".
69func makeTool(name string) mcpserver.ServerTool {
70 return mcpserver.ServerTool{
71 Tool: mcp.NewTool(name),
72 Handler: func(_ context.Context, _ mcp.CallToolRequest) (*mcp.CallToolResult, error) {
73 return mcp.NewToolResultText("ok"), nil
74 },
75 }
76}
77
78// makeConfig builds a database.MCPServerConfig suitable for tests.
79func makeConfig(slug, url string) database.MCPServerConfig {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected