Skip to main content
Glama
ajaystream

HubSpot MCP Server

by ajaystream

hubspot-get-schemas

Read-onlyIdempotent

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';
Behavior4/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, openWorldHint=true, and idempotentHint=true, covering safety and idempotency. The description adds value by specifying the return format ('Provides the objectTypeId and objectType for each schema') and how to use these attributes in subsequent requests, which is useful context beyond annotations. No contradictions exist.

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 well-structured with emoji-labeled sections (🎯 Purpose, 🧭 Usage Guidance, 📦 Returns), front-loading key information. Each sentence earns its place by providing essential details without redundancy. It's appropriately sized for a zero-parameter tool.

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

Completeness5/5

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

Given the tool's zero parameters, rich annotations (covering safety and behavior), and no output schema, the description is complete. It explains the purpose, usage context, and return format clearly. For a read-only schema retrieval tool, this provides all necessary context for an AI agent.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately focuses on output semantics, explaining what the tool returns and how to use the results. This adds meaningful value beyond the schema.

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

Purpose5/5

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

The description clearly states the specific verb ('Retrieves') and resource ('all custom object schemas defined in the HubSpot account'), distinguishing it from siblings like hubspot-list-objects or hubspot-get-property which handle different resources. The purpose is precise and unambiguous.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool: 'Before working with custom objects to understand available object types, their properties, and associations.' This provides clear context and distinguishes it from alternatives like hubspot-list-objects (which lists instances, not schemas) or hubspot-get-property (which retrieves property definitions, not object schemas).

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

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