MCPcopy
hub / github.com/github/github-mcp-server / getTextResult

Function getTextResult

pkg/github/helper_test.go:389–396  ·  view source on GitHub ↗

getTextResult is a helper function that returns a text result from a tool call.

(t *testing.T, result *mcp.CallToolResult)

Source from the content-addressed store, hash-verified

387
388// getTextResult is a helper function that returns a text result from a tool call.
389func getTextResult(t *testing.T, result *mcp.CallToolResult) *mcp.TextContent {
390 t.Helper()
391 assert.NotNil(t, result)
392 require.Len(t, result.Content, 1)
393 textContent, ok := result.Content[0].(*mcp.TextContent)
394 require.True(t, ok, "expected content to be of type TextContent")
395 return textContent
396}
397
398func getErrorResult(t *testing.T, result *mcp.CallToolResult) *mcp.TextContent {
399 res := getTextResult(t, result)

Calls

no outgoing calls

Tested by

no test coverage detected