Skip to content

New-PodeMcpTextContent

SYNOPSIS

Builds a Textual response object for an MCP tool, which can be returned to the client.

SYNTAX

New-PodeMcpTextContent [[-Value] <Object>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

This function creates a hashtable representing a textual response for an MCP tool. The hashtable includes a 'type' key with the value 'text', and a 'text' key containing the provided value. If the provided value is not a string, it will be converted to a string using Out-String.

EXAMPLES

EXAMPLE 1

# create a simple text response for an MCP tool
New-PodeMcpTextContent -Value 'Hello, world!'

EXAMPLE 2

# create a text response for an MCP tool from a non-string object
$data = @{ Name = 'Alice'; Age = 30 }
New-PodeMcpTextContent -Value $data

PARAMETERS

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Value

The value to be included in the textual response. This can be any object, which will be converted to a string if necessary.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Collections.Hashtable

NOTES