For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
        • body
        • description
        • enableEnvExpansion
        • errorKeys
        • expression
        • fallbackOutput
        • foreach
        • globalErrorKeys
        • helpers
        • output
        • parameter
        • params
        • purpose
        • registerWithAgent
        • setAllowedEnvPrefixes
        • toSwaigFunction
        • webhook
        • webhookExpressions
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Example
AgentsDataMap

parameter

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

params

Next
Built with

Add a function parameter to the tool definition.

Parameters

name
stringRequired

Parameter name.

paramType
stringRequired

JSON schema type for the parameter.

  • "string" — text value
  • "integer" — whole number value
  • "number" — numeric value including decimals
  • "boolean" — true or false value
  • "array" — list of values
  • "object" — nested key-value structure
description
stringRequired

Description of the parameter shown to the AI.

opts
object

Optional configuration.

opts.required
boolean

Whether this parameter is required.

opts.enum
string[]

Optional list of allowed values for this parameter.

Returns

DataMap — Self for method chaining.

Example

1import { DataMap } from '@signalwire/sdk';
2
3const weather = new DataMap('get_weather');
4weather
5 .purpose('Get current weather for a city')
6 .parameter('city', 'string', 'City name', { required: true })
7 .parameter('units', 'string', 'Temperature units', { enum: ['fahrenheit', 'celsius'] });
8
9console.log(weather.toSwaigFunction());