Skip to navigation

getSkillNamespace

View as MarkdownOpen in Claude

Returns the namespace key used to store this skill’s data within the agent’s global data. This key scopes the skill’s state to avoid collisions with other skills.

Takes no parameters.

Returns

string — The namespace key for this skill instance.

Example

import { SkillBase, FunctionResult, type SkillToolDefinition } from '@signalwire/sdk';
class WeatherSkill extends SkillBase {
static override SKILL_NAME = 'weather';
static override SKILL_DESCRIPTION = 'Look up the weather.';
override getTools(): SkillToolDefinition[] {
return [{
name: 'get_weather',
description: 'Get the weather.',
parameters: { type: 'object', properties: {} },
handler: () => {
const namespace = this.getSkillNamespace();
console.log(namespace); // e.g., "skill:weather"
return new FunctionResult('Sunny.');
},
}];
}
}