list_users
Retrieve a paginated list of BoldSign users with optional search filtering to find specific team members or contacts in your e-signature platform.
Instructions
Retrieves a paginated list of BoldSign users, with optional filtering by a search term.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | ||
| pageSize | Yes | ||
| search | No | Optional. A string used to filter the user list. The API will return contacts whose details contain this search term. |
Implementation Reference
- src/tools/usersTools/listUsers.ts:29-45 (handler)Core implementation of the list_users tool: creates UserApi instance, calls listUsers with page, pageSize, search parameters, handles response and errors using utility functions.async function listUsersHandler(payload: ListUsersSchemaType): Promise<McpResponse> { try { const userApi = new UserApi(); userApi.basePath = configuration.getBasePath(); userApi.setApiKey(configuration.getApiKey()); const userRecords: UserRecords = await userApi.listUsers( payload.page, payload.pageSize ?? undefined, payload.search ?? undefined, ); return handleMcpResponse({ data: userRecords, }); } catch (error: any) { return handleMcpError(error); } }
- Zod input schema for the list_users tool defining pageSize (1-100), page (default 1), and optional search string.const ListUsersSchema = z.object({ pageSize: z.number().int().min(1).max(100), page: z.number().int().min(1).default(1), search: commonSchema.OptionalStringSchema.describe( 'Optional. A string used to filter the user list. The API will return contacts whose details contain this search term.', ), });
- src/tools/usersTools/listUsers.ts:19-27 (registration)Registers the list_users tool definition with MCP-compatible structure: method name 'list_users', description, input schema, and wrapper handler delegating to the core handler.export const listUsersToolDefinition: BoldSignTool = { method: ToolNames.ListUsers.toString(), name: 'List users', description: 'Retrieves a paginated list of BoldSign users, with optional filtering by a search term.', inputSchema: ListUsersSchema, async handler(args: unknown): Promise<McpResponse> { return await listUsersHandler(args as ListUsersSchemaType); }, };
- src/tools/index.ts:8-14 (registration)Aggregates all tool definitions including usersApiToolsDefinitions (which contains listUsersToolDefinition) into the main definitions array used by the MCP server.export const definitions: BoldSignTool[] = [ ...contactsApiToolsDefinitions, ...documentsApiToolsDefinitions, ...templatesApiToolsDefinitions, ...usersApiToolsDefinitions, ...teamsApiToolsDefinitions, ];
- src/index.ts:22-60 (registration)Final MCP server registration: handles ListToolsRequest by listing all tools from definitions (including list_users), and CallToolRequest by finding and executing the matching tool's handler with input validation.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: definitions.map((toolDefinition: BoldSignTool) => { return { name: toolDefinition.method, description: toolDefinition.description, inputSchema: zodToJsonSchema(toolDefinition.inputSchema), }; }), })); server.setRequestHandler(CallToolRequestSchema, async (request) => { const toolName = request.params.name; const tool = definitions.find((t) => t.method === toolName); if (!tool) { throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${toolName}`); } const args = request.params.arguments; const schemaResult = tool.inputSchema.safeParse(args); if (!schemaResult.success) { throw new McpError( ErrorCode.InvalidParams, `Invalid parameters for tool ${toolName}: ${schemaResult.error.message}`, ); } try { const result = await tool.handler(args); return { content: [{ type: 'text', text: `${toJsonString(result)}` }], }; } catch (error) { console.error('[Error] Failed to fetch data:', error); const errorMessage = error instanceof Error ? error.message : String(error); throw new McpError(ErrorCode.InternalError, `API error: ${errorMessage}`); } });