mcpresult

package
v0.3.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTextContent

func ExtractTextContent(result map[string]interface{}) string

ExtractTextContent returns the concatenated text from text content items in a raw MCP tool result map. Content items with a missing "type" are treated as text items for compatibility with older callers and tests.

func NormalizeContentItems added in v0.3.26

func NormalizeContentItems(contentVal interface{}) ([]map[string]interface{}, bool)

NormalizeContentItems normalizes an MCP "content" field into a slice of item maps. It supports both []interface{} values produced by json.Unmarshal and []map[string]interface{} values produced by helper constructors.

Non-map items in []interface{} are skipped so callers can decide whether to ignore them or treat them as an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL