feat: add support for listing devices#46
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Devices endpoint to the Make SDK to support listing mobile devices registered to a team, along with associated typings, MCP tool definition, and test coverage. Also extends existing connection/hook types to include additional scenario metadata and bumps the package version.
Changes:
- Add
make.devices.list(teamId)endpoint +Device/DeviceInfo/ListDevicesOptionstypes. - Add a Jest spec + mock response fixture for listing devices.
- Extend
HookandConnectiontypes with additional scenario-related fields; bump version to1.1.0.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/mocks/devices/list.json | Adds mock API response for /devices listing. |
| test/devices.spec.ts | Adds unit test verifying make.devices.list(teamId) request/response mapping. |
| src/make.ts | Wires the new devices endpoint onto the Make client. |
| src/index.ts | Re-exports devices-related public types. |
| src/endpoints/hooks.ts | Extends Hook type with optional scenario metadata fields. |
| src/endpoints/devices.ts | Implements the Devices endpoint class and related types. |
| src/endpoints/devices.mcp.ts | Defines an MCP tool for listing devices. |
| src/endpoints/connections.ts | Extends Connection type with optional scenarioUsages. |
| package.json | Version bump to 1.1.0. |
| package-lock.json | Lockfile version bump to 1.1.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const tools = [ | ||
| { | ||
| name: 'devices_list', | ||
| title: 'List devices', | ||
| description: 'List devices registered in a team', | ||
| category: 'devices', | ||
| scope: 'devices:read', | ||
| identifier: 'teamId', | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| teamId: { type: 'number', description: 'The team ID to list devices for' }, | ||
| }, | ||
| required: ['teamId'], | ||
| }, | ||
| execute: async (make: Make, args: { teamId: number }) => { | ||
| return await make.devices.list(args.teamId); | ||
| }, | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
This MCP tool definition isn’t wired into the exported MCP tool registry. src/mcp.ts enumerates endpoint tools via explicit imports/spreads into MakeMCPTools, but it doesn’t import/spread ./endpoints/devices.mcp.js, so devices_list won’t be discoverable/usable via MCP.
| /** | ||
| * List devices for a team. | ||
| * @param teamId The team ID to list devices for | ||
| * @param options Optional parameters for filtering and pagination |
There was a problem hiding this comment.
The JSDoc for list() says options is for “filtering and pagination”, but ListDevicesOptions currently only supports cols. This is misleading for SDK consumers; update the comment to match the actual supported options (or add the missing options if they’re intended).
| * @param options Optional parameters for filtering and pagination | |
| * @param options Optional parameters for selecting response columns |
Adds support for listing devices + updates connection and hook types.