hs_list_forms
List all HubSpot forms ordered by most recently updated, with optional limit on number of forms returned. Helps track form activity and changes.
Instructions
List all HubSpot forms ordered by most recently updated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- src/tools/forms.ts:8-14 (handler)The `listForms` handler function that calls the HubSpot API to list forms, accepting an optional `limit` and sorting by `updatedAt` descending.
export async function listForms(args: z.infer<typeof ListFormsSchema>) { return hubspot("/forms/v2/forms", "GET", undefined, { limit: args.limit ?? 20, orderBy: "updatedAt", direction: "desc", }); } - src/tools/forms.ts:4-6 (schema)The `ListFormsSchema` defining input validation: optional `limit` (int 1-50, default 20).
export const ListFormsSchema = z.object({ limit: z.number().int().min(1).max(50).default(20).optional(), }); - src/index.ts:241-246 (registration)Registration of the "hs_list_forms" tool using `server.tool()` with description and schema.
server.tool( "hs_list_forms", "List all HubSpot forms ordered by most recently updated.", ListFormsSchema.shape, async (args) => { try { return ok(await listForms(args)); } catch (e) { return err(e); } }, ); - src/index.ts:52-56 (helper)Import of `ListFormsSchema` and `listForms` from the forms tool module.
import { ListFormsSchema, listForms, GetFormSchema, getForm, FormSubmissionsSchema, formSubmissions, } from "./tools/forms.js";