Skip to content

Update-PodeMcpTool

SYNOPSIS

Updates an existing MCP tool.

SYNTAX

Update-PodeMcpTool [-Name] <String> [[-Description] <String>] [[-ScriptBlock] <ScriptBlock>] [-ResetProperties]
 [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Updates the properties of an existing MCP tool, including its description, scriptblock, and/or resetting the properties.

EXAMPLES

EXAMPLE 1

# update the description of an existing MCP tool
Update-PodeMcpTool -Name 'GreetPerson' -Description 'Returns a random greeting to a person, updated description'

EXAMPLE 2

# update the scriptblock of an existing MCP tool, and reset its properties
Update-PodeMcpTool -Name 'GreetPerson' -ScriptBlock {
    param(
        [string]$Name,
        [string]$Location
    )
    $greetings = @('Hello', 'Hi', 'Hey', 'Greetings', 'Salutations')
    $greeting = Get-Random -InputObject $greetings
    return New-PodeMcpTextContent -Value "$($greeting), $($Name) from $($Location)! via the updated Pode MCP tool!"
} -ResetProperties

PARAMETERS

-Description

An optional new Description for the MCP tool.

Type: String
Parameter Sets: (All)
Aliases:

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

-Name

The Name of the MCP tool to update.

Type: String
Parameter Sets: (All)
Aliases:

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

-PassThru

A switch parameter to return the updated MCP tool.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-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

-ResetProperties

A switch to reset the Properties of the MCP tool, if a new ScriptBlock has changed the parameters which need to be supplied.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-ScriptBlock

An optional new ScriptBlock for the MCP tool.

Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
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

NOTES