getParameterSchema

View as MarkdownOpen in Claude

Static class method that returns metadata about all parameters the skill accepts. Subclasses should override this method and merge their own parameters with the result of super.getParameterSchema().

Takes no parameters.

Returns

Record<string, ParameterSchemaEntry> — Parameter schema where keys are parameter names and values describe the parameter.

ParameterSchemaEntry fields:

FieldTypeDescription
typestring"string", "integer", "number", "boolean", "object", "array"
descriptionstringHuman-readable description
defaultanyDefault value
requiredbooleanWhether the parameter is required
hiddenbooleanHide in UIs (for secrets like API keys)
env_varstringEnvironment variable that can provide this value
enumunknown[]Allowed values
min / maxnumberBounds for numeric types
itemsobjectSchema for array item types

Example

1import { SkillBase, SkillManifest, SkillToolDefinition, ParameterSchemaEntry } from '@signalwire/sdk';
2
3class WeatherSkill extends SkillBase {
4 constructor(config?: Record<string, unknown>) {
5 super('weather', config);
6 }
7
8 static getParameterSchema(): Record<string, ParameterSchemaEntry> {
9 return {
10 ...super.getParameterSchema(),
11 units: {
12 type: 'string',
13 description: 'Temperature units',
14 default: 'fahrenheit',
15 enum: ['fahrenheit', 'celsius'],
16 },
17 api_key: {
18 type: 'string',
19 description: 'Weather API key',
20 required: true,
21 hidden: true,
22 env_var: 'WEATHER_API_KEY',
23 },
24 };
25 }
26
27 getManifest(): SkillManifest {
28 return { name: 'weather', description: 'Provides weather information', version: '1.0.0' };
29 }
30
31 getTools(): SkillToolDefinition[] {
32 return [];
33 }
34}
35
36// Inspect the schema (includes base params swaig_fields, skip_prompt)
37console.log(WeatherSkill.getParameterSchema());
38// { swaig_fields: { ... }, skip_prompt: { ... }, units: { ... }, api_key: { ... } }