MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / NewMCPDynamicTool

Function NewMCPDynamicTool

tools/mcp.go:22–42  ·  view source on GitHub ↗
(publicName, serverName, toolName, description string, rawSchema map[string]any, searchHint string)

Source from the content-addressed store, hash-verified

20 ToolName string
21 RawSchema map[string]any
22}
23
24func NewMCPDynamicTool(publicName, serverName, toolName, description string, rawSchema map[string]any, searchHint string) *MCPDynamicTool {
25 if rawSchema == nil {
26 rawSchema = map[string]any{"type": "object", "properties": map[string]any{}}
27 }
28 return &MCPDynamicTool{
29 BaseTool: BaseTool{Spec: ToolSpec{
30 Name: publicName,
31 Description: description,
32 InputPrototype: nil,
33 ShouldDefer: true,
34 SearchHint: searchHint,
35 ReadOnly: BoolPtr(false),
36 ConcurrencySafe: BoolPtr(true),
37 Destructive: BoolPtr(true),
38 TimeoutSeconds: mcp.DefaultRequestTimeout.Seconds() + 15,
39 MaxOutputChars: 100_000,
40 }},
41 ServerName: serverName,
42 ToolName: toolName,
43 RawSchema: rawSchema,
44 }
45}

Callers 1

RegisterMCPToolsFunction · 0.85

Calls 1

BoolPtrFunction · 0.85

Tested by

no test coverage detected