remove_metadata

View as MarkdownOpen in Claude

Remove one or more keys from the current function’s metadata store.

Parameters

keys
str | list[str]Required

A single key string or a list of key strings to remove from metadata.

Returns

FunctionResult — self, for chaining.

Example

from signalwire import AgentBase
from signalwire import FunctionResult
agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")
@agent.tool(name="clear_metadata", description="Clear function metadata")
def clear_metadata(args, raw_data):
return (
FunctionResult("Metadata cleared.")
.remove_metadata(["timestamp", "user_id"])
)
agent.serve()