Skip to main content
Glama

hubspot-get-schemas

Retrieve all custom object schemas defined in a HubSpot account to identify object types, properties, and associations. Use the returned objectTypeId and objectType for accurate API requests.

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • The process method that executes the tool: fetches schemas from '/crm-object-schemas/v3/schemas', simplifies results, and returns formatted response or error.
    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 input schema (empty object) and tool definition with name, description, inputSchema, and annotations.
    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 GetSchemasTool in the tools registry.
    registerTool(new GetSchemasTool());

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