Skip to main content
Glama
kesslerio

Attio MCP Server

by kesslerio

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')}`;
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions search functionality but does not disclose behavioral traits such as permissions needed, rate limits, pagination, or response format. This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It is appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not explain return values, error conditions, or behavioral constraints, which are crucial for a search tool with no structured data to compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'query' parameter. The description adds minimal value by specifying searchable attributes (name, email, role), but does not provide additional syntax or format details beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Search') and resource ('workspace members'), specifying the searchable attributes (name, email, or role). However, it does not differentiate from sibling tools like 'list-workspace-members' or 'get-workspace-member', which reduces clarity about when to use this specific search tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'list-workspace-members' and 'get-workspace-member', the description lacks context on use cases, prerequisites, or exclusions, leaving the agent to infer usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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