> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# getTool

> Look up a registered SwaigFunction by name.

Look up a registered `SwaigFunction` on this service by name.

## **Parameters**

The tool name to search for.

## **Returns**

`SwaigFunction | undefined` -- The `SwaigFunction` instance, or `undefined` if
not found or not a `SwaigFunction` (e.g., a raw `DataMap` descriptor).

## **Example**

```typescript {12}
import { SWMLService } from '@signalwire/sdk';

const service = new SWMLService({ name: 'swaig-host', route: '/' });
service.defineTool({
  name: 'get_weather',
  description: 'Get the current weather',
  parameters: { type: 'object', properties: { city: { type: 'string' } } },
  handler: async (args) => ({ response: `Weather in ${args.city}: sunny` }),
});

const tool = service.getTool('get_weather');
if (tool) {
  console.log(tool.description); // "Get the current weather"
}
```