MCPcopy
hub / github.com/grafana/tempo / handleTraceQLDocs

Method handleTraceQLDocs

modules/frontend/mcp_tools.go:41–55  ·  view source on GitHub ↗
(_ context.Context, request mcp.CallToolRequest)

Source from the content-addressed store, hash-verified

39)
40
41func (s *MCPServer) handleTraceQLDocs(_ context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
42 metricMCPToolCalls.WithLabelValues(toolDocsTraceQL).Inc()
43
44 docType, err := request.RequireString("name")
45 if err != nil {
46 return mcp.NewToolResultError(err.Error()), nil
47 }
48
49 level.Info(s.logger).Log("msg", "traceql docs requested", "doc_type", docType)
50
51 // Get the appropriate documentation content based on the requested type
52 content := docs.GetDocsContent(docType)
53
54 return toolResult(content, MetaTypeDocumentation, "markdown", "1"), nil
55}
56
57// handleSearch handles the traceql-search tool
58func (s *MCPServer) handleSearch(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {

Callers 1

TestHandleTraceQLDocsFunction · 0.95

Calls 5

GetDocsContentFunction · 0.92
toolResultFunction · 0.70
IncMethod · 0.65
ErrorMethod · 0.65
LogMethod · 0.65

Tested by 1

TestHandleTraceQLDocsFunction · 0.76