MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / textContent

Function textContent

mcp/streamable_test.go:1742–1752  ·  view source on GitHub ↗
(t *testing.T, res *CallToolResult)

Source from the content-addressed store, hash-verified

1740}
1741
1742func textContent(t *testing.T, res *CallToolResult) string {
1743 t.Helper()
1744 if len(res.Content) != 1 {
1745 t.Fatalf("len(Content) = %d, want 1", len(res.Content))
1746 }
1747 text, ok := res.Content[0].(*TextContent)
1748 if !ok {
1749 t.Fatalf("Content[0] is %T, want *TextContent", res.Content[0])
1750 }
1751 return text.Text
1752}
1753
1754func TestSessionHijackingPrevention(t *testing.T) {
1755 // This test verifies that sessions bound to a user ID cannot be accessed

Callers 1

TestStreamableStatelessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…