Skip to main content
Glama
kesslerio

Attio MCP Server

by kesslerio

get-attributes

Read-onlyIdempotent

Retrieve attribute data for CRM resources including companies, people, lists, records, tasks, deals, and notes by specifying resource type, record ID, categories, or specific fields.

Instructions

Get attributes for any resource type (companies, people, lists, records, tasks, deals, notes)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoriesNoAttribute categories
fieldsNoSpecific attribute field names
record_idNoRecord ID to get attributes for (optional)
resource_typeYesType of resource to operate on (companies, people, lists, records, tasks)

Implementation Reference

  • Tool alias registration: 'get-attributes' maps to canonical 'records_get_attributes'
    'get-attributes': {
      target: 'records_get_attributes',
      reason: 'Phase 1 search tool rename (#776)',
      since: SINCE_PHASE_1,
      removal: 'v1.x (TBD)',
    },
  • Input schema definition for get-attributes tool (records_get_attributes)
    export const getAttributesSchema = {
      type: 'object' as const,
      properties: {
        resource_type: resourceTypeProperty,
        record_id: {
          type: 'string' as const,
          description: 'Record ID to get attributes for (optional)',
        },
        categories: {
          type: 'array' as const,
          items: { type: 'string' as const },
          description: 'Attribute categories',
        },
        fields: {
          type: 'array' as const,
          items: { type: 'string' as const },
          description: 'Specific attribute field names',
        },
      },
      required: ['resource_type' as const],
      additionalProperties: false,
      examples: [
        {
          resource_type: 'companies',
          categories: ['standard'],
        },
      ],
    };
  • Tool handler configuration: validates params and delegates to UniversalMetadataService via shared handler
    export const getAttributesConfig: UniversalToolConfig<
      UniversalAttributesParams,
      Record<string, unknown> | { error: string; success: boolean }
    > = {
      name: 'records_get_attributes',
      handler: async (
        params: UniversalAttributesParams
      ): Promise<Record<string, unknown> | { error: string; success: boolean }> => {
        try {
          const sanitizedParams = validateUniversalToolParams(
            'records_get_attributes',
            params
          );
          return await handleUniversalGetAttributes(sanitizedParams);
        } catch (error: unknown) {
          const errorMessage =
            error instanceof Error ? error.message : String(error);
          return { error: errorMessage, success: false };
        }
      },
      formatResult: (
        attributes: Record<string, unknown>,
        ...args: unknown[]
      ): string => {
        const resourceType = args[0] as UniversalResourceType | undefined;
        if (!attributes) {
          return 'No attributes found';
        }
    
        const resourceTypeName = resourceType
          ? getSingularResourceType(resourceType)
          : 'record';
    
        if (Array.isArray(attributes)) {
          return `${resourceTypeName.charAt(0).toUpperCase() + resourceTypeName.slice(1)} attributes (${attributes.length}):\n${attributes
            .map((attr: Record<string, unknown>, index: number) => {
              const name =
                attr.title || attr.api_slug || attr.name || attr.slug || 'Unnamed';
              const type = attr.type || 'unknown';
              return `${index + 1}. ${name} (${type})`;
            })
            .join('\n')}`;
        }
    
        if (typeof attributes === 'object' && attributes !== null) {
          if (attributes.all && Array.isArray(attributes.all)) {
            return `Available ${resourceTypeName} attributes (${(attributes.all as []).length}):\n${(
              attributes.all as Record<string, unknown>[]
            )
              .map((attr: Record<string, unknown>, index: number) => {
                const name =
                  attr.title ||
                  attr.api_slug ||
                  attr.name ||
                  attr.slug ||
                  'Unnamed';
                const type = attr.type || 'unknown';
                return `${index + 1}. ${name} (${type})`;
              })
              .join('\n')}`;
          }
    
          if (attributes.attributes && Array.isArray(attributes.attributes)) {
            return `Available ${resourceTypeName} attributes (${(attributes.attributes as []).length}):\n${(
              attributes.attributes as Record<string, unknown>[]
            )
              .map((attr: Record<string, unknown>, index: number) => {
                const name = attr.name || attr.api_slug || attr.slug || 'Unnamed';
                const type = attr.type || 'unknown';
                return `${index + 1}. ${name} (${type})`;
              })
              .join('\n')}`;
          }
    
          const keys = Object.keys(attributes);
          if (keys.length > 0) {
            return `${resourceTypeName.charAt(0).toUpperCase() + resourceTypeName.slice(1)} attributes (${keys.length}):\n${keys
              .map((key, index) => {
                const value = attributes[key];
                if (typeof value === 'string') {
                  return `${index + 1}. ${key}: "${value}"`;
                }
                return `${index + 1}. ${key}`;
              })
              .join('\n')}`;
          }
        }
    
        return `${resourceTypeName.charAt(0).toUpperCase() + resourceTypeName.slice(1)} attributes available`;
      },
    };
  • Shared handler delegate: routes to UniversalMetadataService.getAttributes
    export async function handleUniversalGetAttributes(
      params: UniversalAttributesParams
    ): Promise<JsonObject> {
      return UniversalMetadataService.getAttributes(params);
    }
  • Core implementation: Routes to resource-specific metadata getters based on resource_type, applies category filtering
    async getAttributes(params: UniversalAttributesParams): Promise<JsonObject> {
      const { resource_type, record_id, categories } = params;
    
      let result: JsonObject;
    
      switch (resource_type) {
        case UniversalResourceType.COMPANIES: {
          if (record_id) {
            result = await getCompanyAttributes(record_id);
          } else {
            result = await discoverCompanyAttributes();
          }
          break;
        }
    
        case UniversalResourceType.PEOPLE: {
          if (record_id) {
            result = await this.recordService.getAttributesForRecord(
              resource_type,
              record_id
            );
          } else {
            result = await this.discoverAttributesForResourceType(resource_type, {
              categories,
            });
          }
          break;
        }
    
        case UniversalResourceType.LISTS: {
          result = await getListAttributes();
          break;
        }
    
        case UniversalResourceType.RECORDS: {
          if (record_id) {
            result = await this.recordService.getAttributesForRecord(
              resource_type,
              record_id
            );
          } else {
            result = await this.discoverAttributesForResourceType(resource_type, {
              categories,
            });
          }
          break;
        }
    
        case UniversalResourceType.DEALS: {
          if (record_id) {
            result = await this.recordService.getAttributesForRecord(
              resource_type,
              record_id
            );
          } else {
            result = await this.discoverAttributesForResourceType(resource_type, {
              categories,
            });
          }
          break;
        }
    
        case UniversalResourceType.TASKS: {
          if (record_id) {
            result = await this.recordService.getAttributesForRecord(
              resource_type,
              record_id
            );
          } else {
            result = await this.discoverAttributesForResourceType(resource_type, {
              categories,
            });
          }
          break;
        }
    
        default:
          throw new Error(
            `Unsupported resource type for get attributes: ${resource_type}`
          );
      }
    
      const filtered = this.transformService.filterByCategory(result, categories);
      return filtered as JsonObject;
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the agent knows this is a safe, repeatable read operation. The description adds value by specifying the scope ('for any resource type') but doesn't disclose additional behavioral traits like rate limits, authentication needs, or what happens with invalid resource types. No contradiction with annotations.

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?

Single sentence, zero waste. It efficiently conveys the tool's purpose and scope without unnecessary words, making it easy for an AI agent to parse quickly.

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

Completeness3/5

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

Given annotations cover safety (read-only, idempotent) and schema fully describes parameters, the description is minimally adequate. However, with no output schema and multiple sibling tools, it lacks context on return format, error handling, or differentiation from similar tools like 'discover-attributes', leaving gaps for an AI agent.

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 fully documents all 4 parameters. The description mentions 'resource type' and implies attribute retrieval but doesn't add meaning beyond what the schema provides (e.g., explaining relationships between parameters or usage examples). Baseline 3 is appropriate given high schema coverage.

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 'Get' and the resource 'attributes', specifying it works for multiple resource types (companies, people, lists, records, tasks, deals, notes). It distinguishes from some siblings like 'get-record-details' or 'get-list-details' by focusing on attributes rather than general details, but doesn't explicitly differentiate from 'discover-attributes' which might be a similar 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 on when to use this tool versus alternatives. The description doesn't mention when to choose this over 'get-record-details', 'get-list-details', or 'discover-attributes', nor does it provide context about prerequisites or appropriate scenarios for attribute retrieval.

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