@servicenow/sdk - v4.7.0
    Preparing search index...

    Interface SkillDefinition<TInputs, TTools>

    Skill definition — the first argument to NowAssistSkillConfig() Contains all skill metadata, inputs, outputs, tools, and settings.

    TypeScript infers TInputs from the inputs property and TTools from the tools callback return type. Because both live in this first argument, they are fully resolved before the second argument (SkillPromptConfig) is contextually typed, which guarantees correct IntelliSense for p.tool.* and p.input.* in prompt builder callbacks.

    // First argument to NowAssistSkillConfig():
    {
    $id: Now.ID['life_tips_skill'],
    name: 'Life tips on user problem',
    shortDescription: 'Provides life tips',
    description: 'Life tips on user problem',
    inputs: [
    {
    $id: Now.ID['life_tips_user_problem_input'],
    name: 'user problem',
    description: 'Explain about user problem',
    mandatory: true,
    testValues: 'Having backpain since 2 days',
    dataType: 'string'
    }
    ],
    outputs: [
    // Standard outputs (required — only $id and name)
    { $id: Now.ID['life_tips_response_output'], name: 'response' },
    { $id: Now.ID['life_tips_provider_output'], name: 'provider' },
    { $id: Now.ID['life_tips_errorcode_output'], name: 'errorcode' },
    { $id: Now.ID['life_tips_status_output'], name: 'status' },
    { $id: Now.ID['life_tips_error_output'], name: 'error' },
    ],
    securityControls: {
    userAccess: { type: 'authenticated' },
    roleRestrictions: ['2831a114c611228501d4ea6c309d626d']
    }
    }
    interface SkillDefinition<
        TInputs extends readonly InputAttribute[] = readonly InputAttribute[],
        TTools extends
            Record<string, BaseToolHandle> = Record<string, BaseToolHandle>,
    > {
        deploymentSettings?: DeploymentSettings;
        description?: string;
        inputs?: TInputs;
        name: string;
        outputs?: OutputAttribute<keyof Tables>[];
        securityControls: SecurityControls;
        shortDescription?: string;
        skillSettings?: SkillSettings;
        state?: "published";
        tools?: (tools: ToolGraphBuilder<TInputs>) => void | TTools;
    }

    Type Parameters

    Index

    Properties

    deploymentSettings?: DeploymentSettings

    Deployment settings for UI Action and UI Builder

    description?: string

    Detailed explanation of what the skill does, shown on the skill detail page

    inputs?: TInputs

    Input attributes for the skill Define as an inline array — type inference is automatic

    inputs: [
    { $id: Now.ID['my_skill_field_input'], name: 'field', dataType: 'string', mandatory: true }
    ]
    name: string

    Display name shown in the NowAssist skill picker and admin views

    outputs?: OutputAttribute<keyof Tables>[]

    Skill output attributes (optional). The 5 standard outputs (response, provider, errorcode, status, error) are always created. If omitted or partially provided, missing standard outputs are auto-generated with derived IDs. On transform, all outputs (including auto-generated ones) are synced back to code.

    // Explicit standard outputs (recommended for stable identity)
    outputs: [
    { $id: Now.ID['my_skill_response_output'], name: 'response', dataType: 'string' },
    { $id: Now.ID['my_skill_provider_output'], name: 'provider', dataType: 'string' },
    { $id: Now.ID['my_skill_errorcode_output'], name: 'errorcode', dataType: 'string' },
    { $id: Now.ID['my_skill_status_output'], name: 'status', dataType: 'string' },
    { $id: Now.ID['my_skill_error_output'], name: 'error', dataType: 'string' },
    { $id: Now.ID['my_custom_out'], name: 'myCustomField', dataType: 'string', description: 'Extra output' },
    ]

    // Or omit entirely — standard outputs are auto-generated
    securityControls: SecurityControls

    Security controls for user access and role restrictions MANDATORY: Must be provided for all skills Defines who can access the skill and what roles it can inherit during execution

    securityControls: {
    userAccess: { type: 'authenticated' },
    roleRestrictions: ['2831a114c611228501d4ea6c309d626d'] // or use `roleMap: ['admin', 'itil']` (preferred for ZP10 / AP3+)
    }
    shortDescription?: string

    Brief one-line summary displayed in skill listings and search results

    skillSettings?: SkillSettings

    Skill-level settings including providers

    state?: "published"

    Skill state Set to "published" to publish the skill (state = 1) If not provided, skill will be in draft state (state = 0)

    // Draft skill (default)
    { name: 'My Skill' }
    // Published skill
    { name: 'My Skill', state: 'published' }
    tools?: (tools: ToolGraphBuilder<TInputs>) => void | TTools

    Tool graph configuration (optional) Define tools that the skill can use during execution

    IMPORTANT: Return tool handles to enable type-safe tool output access in prompts!

    Supported Tool Types:

    • Script: Script Include execution
    • InlineScript: Inline script execution
    • FlowAction: Flow Action execution
    • Subflow: Subflow execution
    • Skill: Skill-as-Tool execution
    • WebSearch: Web search capabilities
    • Decision: Conditional branching logic
    tools: (t) => ({
    createIncident: t.FlowAction('CreateIncident', {
    $id: Now.ID['my_skill_create_incident_tool'],
    actionId: 'flow_action_sys_id',
    inputs: [
    { name: 'short_description', type: 'string', value: t.input.incidentNumber },
    { name: 'priority', type: 'string', value: t.input.priority }
    ],
    outputs: [
    { name: 'sys_id', type: 'string' },
    { name: 'number', type: 'string' }
    ]
    }),

    searchKB: t.WebSearch('SearchKB', {
    $id: Now.ID['my_skill_search_kb_tool'],
    searchType: 'ai_answers',
    query: t.input.query
    })
    })