updateSkillData

View as MarkdownOpen in Claude

Writes data under this skill’s namespace into a FunctionResult object. This persists skill state across tool invocations by embedding it in the agent’s global data.

Parameters

result
FunctionResultRequired

The FunctionResult to update with the skill’s namespaced data.

data
Record<string, unknown>Required

The data to store under this skill’s namespace.

Returns

FunctionResult — The updated FunctionResult with the skill data merged in.

Example

1import { SkillBase } from '@signalwire/sdk';
2
3// Inside a tool handler, persist skill state
4const updatedResult = mySkill.updateSkillData(result, {
5 lastQuery: 'New York',
6 cachedResponse: { temp: 72, conditions: 'sunny' },
7});