Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(hubspot): align total fallback with type definitions in search tools
Use `?? 0` instead of `?? null` for search tools where the type declares
`total: number`. Also declare `total` in list_lists metadata output schema.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Loading branch information
waleedlatif1 and claude committed Mar 25, 2026
commit cd7747d2d88310993947534d99e51a1fd2117bfb
11 changes: 9 additions & 2 deletions apps/sim/tools/hubspot/list_lists.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createLogger } from '@sim/logger'
import type { HubSpotListListsParams, HubSpotListListsResponse } from '@/tools/hubspot/types'
import { LISTS_ARRAY_OUTPUT, METADATA_OUTPUT, PAGING_OUTPUT } from '@/tools/hubspot/types'
import { LISTS_ARRAY_OUTPUT, METADATA_OUTPUT_PROPERTIES, PAGING_OUTPUT } from '@/tools/hubspot/types'
import type { ToolConfig } from '@/tools/types'

const logger = createLogger('HubSpotListLists')
Expand Down Expand Up @@ -94,7 +94,14 @@ export const hubspotListListsTool: ToolConfig<HubSpotListListsParams, HubSpotLis
outputs: {
lists: LISTS_ARRAY_OUTPUT,
paging: PAGING_OUTPUT,
metadata: METADATA_OUTPUT,
metadata: {
type: 'object',
description: 'Response metadata',
properties: {
...METADATA_OUTPUT_PROPERTIES,
total: { type: 'number', description: 'Total number of lists matching the query', optional: true },
},
},
success: { type: 'boolean', description: 'Operation success status' },
},
}
2 changes: 1 addition & 1 deletion apps/sim/tools/hubspot/search_companies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const hubspotSearchCompaniesTool: ToolConfig<
success: true,
output: {
companies: data.results || [],
total: data.total ?? null,
total: data.total ?? 0,
paging: data.paging ?? null,
metadata: {
totalReturned: data.results?.length || 0,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/hubspot/search_contacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const hubspotSearchContactsTool: ToolConfig<
success: true,
output: {
contacts: data.results || [],
total: data.total ?? null,
total: data.total ?? 0,
paging: data.paging ?? null,
metadata: {
totalReturned: data.results?.length || 0,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/hubspot/search_deals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const hubspotSearchDealsTool: ToolConfig<
success: true,
output: {
deals: data.results || [],
total: data.total ?? null,
total: data.total ?? 0,
paging: data.paging ?? null,
Comment thread
waleedlatif1 marked this conversation as resolved.
metadata: {
totalReturned: data.results?.length || 0,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/hubspot/search_tickets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const hubspotSearchTicketsTool: ToolConfig<
success: true,
output: {
tickets: data.results || [],
total: data.total ?? null,
total: data.total ?? 0,
paging: data.paging ?? null,
metadata: {
totalReturned: data.results?.length || 0,
Expand Down
Loading