Skip to main content
Glama

search-workspace-members

Find workspace members in Attio CRM by searching for their name, email address, or role using natural language queries.

Instructions

Search workspace members by name, email, or role

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for name, email, or role

Implementation Reference

  • The handler function that implements the core logic for the 'search-workspace-members' tool. It handles mock data scenarios for testing and delegates to the API search function.
    export async function searchWorkspaceMembers( query: string ): Promise<AttioWorkspaceMember[]> { // Check if we should use mock data for testing if (shouldUseMockData()) { if ( process.env.NODE_ENV === 'development' || process.env.VERBOSE_TESTS === 'true' ) { const { createScopedLogger } = await import('../utils/logger.js'); createScopedLogger( 'objects.workspace-members', 'searchWorkspaceMembers' ).debug('Using mock data for workspace members search'); } // Use the list function with search parameter for mocks return listWorkspaceMembers(query); } return apiSearch(query); }
  • Defines the tool schema including input validation, description, constraints, and annotations for 'search-workspace-members'.
    { name: 'search-workspace-members', description: formatToolDescription({ capability: 'Search workspace members by name, email, or access role.', boundaries: 'modify member profiles or permissions; lookup only.', constraints: 'Requires query string (minimum 2 characters).', recoveryHint: 'If no results, list-workspace-members provides the full roster.', }), inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term for member name, email address, or role.', minLength: 2, example: 'operations lead', }, }, required: ['query'], additionalProperties: false, }, annotations: { readOnlyHint: true, idempotentHint: true, }, },
  • Registers the tool configuration, binding the handler function and result formatter to the tool name 'search-workspace-members'.
    searchWorkspaceMembers: { name: 'search-workspace-members', handler: searchWorkspaceMembers, formatResult: (members: AttioWorkspaceMember[]) => formatWorkspaceMembersList( members, 'matching', 'No matching workspace members found.' ), } as ToolConfig,
  • Central tool registry that imports and registers the workspace members tool configs and definitions under ResourceType.WORKSPACE_MEMBERS.
    import { workspaceMembersToolConfigs, workspaceMembersToolDefinitions, } from '../tool-configs/workspace-members.js'; // Import universal tool configurations for consolidated operations import { universalToolConfigs, universalToolDefinitions, } from '../tool-configs/universal/index.js'; /** * Universal tool consolidation (Issue #352): Only expose universal tools * This replaces the legacy resource-specific tools with consolidated universal tools * that can handle all resource types (companies, people, records, tasks) through * a single, consistent interface. * * Legacy tools are kept for backward compatibility but not exposed by default. */ const USE_UNIVERSAL_TOOLS_ONLY = process.env.DISABLE_UNIVERSAL_TOOLS !== 'true'; /** * Consolidated tool configurations from modular files */ export const TOOL_CONFIGS = USE_UNIVERSAL_TOOLS_ONLY ? { // Universal tools for consolidated operations (Issue #352) UNIVERSAL: universalToolConfigs, // Lists are relationship containers - always expose them (Issue #470) [ResourceType.LISTS]: listsToolConfigs, // Workspace members for user discovery (Issue #684) [ResourceType.WORKSPACE_MEMBERS]: workspaceMembersToolConfigs,
  • Helper function to format the list of workspace members for tool responses.
    const formatWorkspaceMembersList = ( members: AttioWorkspaceMember[] | null | undefined, descriptor: string, emptyMessage: string ): string => { if (!members || members.length === 0) return emptyMessage; const descriptorText = descriptor ? `${descriptor} workspace members` : 'workspace members'; return `Found ${members.length} ${descriptorText}:\n${members .map(formatWorkspaceMemberSummary) .join('\n')}`; };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kesslerio/attio-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server