Skip to main content
Glama

hubspot-get-schemas

Retrieve all custom object schemas from HubSpot to understand available object types, properties, and associations for CRM operations.

Instructions

🎯 Purpose: 1. Retrieves all custom object schemas defined in the HubSpot account. 🧭 Usage Guidance: 1. Before working with custom objects to understand available object types, their properties, and associations. 📦 Returns: 1. Provides the objectTypeId and objectType for each schema. 2. These attributes should be used for this object type instead of "custom" in subsequent requests.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `process` method implements the tool's core logic: fetches custom object schemas from HubSpot API endpoint '/crm-object-schemas/v3/schemas', simplifies the results by extracting key fields, formats the response as structured content, and handles errors.
    async process(_args) { try { const schemas = await this.client.get('/crm-object-schemas/v3/schemas'); const simplifiedResults = schemas.results.map((schema) => ({ objectTypeId: schema.objectTypeId, objectType: schema.fullyQualifiedName.split('_')[1], name: schema.name, labels: schema.labels, })); return { content: [ { type: 'text', text: 'Custom object schemas found. Note: These attributes should be used instead of "custom" in subsequent requests:', }, { type: 'text', text: JSON.stringify({ results: simplifiedResults }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving schemas: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
  • Defines the Zod input schema (empty, no parameters required) and the full tool definition including name, description, inputSchema conversion, and annotations for tool metadata.
    const SchemaInfoSchema = z.object({}); const ToolDefinition = { name: 'hubspot-get-schemas', description: ` 🎯 Purpose: 1. Retrieves all custom object schemas defined in the HubSpot account. 🧭 Usage Guidance: 1. Before working with custom objects to understand available object types, their properties, and associations. 📦 Returns: 1. Provides the objectTypeId and objectType for each schema. 2. These attributes should be used for this object type instead of "custom" in subsequent requests. `, inputSchema: zodToJsonSchema(SchemaInfoSchema), annotations: { title: 'Get Object Schemas', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, };
  • Registers an instance of the GetSchemasTool with the central tool registry.
    registerTool(new GetSchemasTool());
  • Imports the GetSchemasTool class required for registration.
    import { GetSchemasTool } from './objects/getSchemaTool.js';

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/ajaystream/hubspot-mcp-custom'

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