@@ -56,22 +56,28 @@ export const pipedriveGetPipelinesTool: ToolConfig<
5656 description : 'Number of results to return (e.g., "50", default: 100, max: 500)' ,
5757 } ,
5858 start : {
59+ type : 'string' ,
60+ required : false ,
61+ visibility : 'user-only' ,
62+ description : 'Ignored: Pipedrive API v2 pages pipelines with cursor instead of an offset' ,
63+ } ,
64+ cursor : {
5965 type : 'string' ,
6066 required : false ,
6167 visibility : 'user-or-llm' ,
62- description : 'Pagination start offset (0-based index of the first item to return) ' ,
68+ description : 'For pagination, the marker representing the first item on the next page ' ,
6369 } ,
6470 } ,
6571
6672 request : {
6773 url : ( params ) => {
68- const baseUrl = 'https://api.pipedrive.com/v1 /pipelines'
74+ const baseUrl = 'https://api.pipedrive.com/api/v2 /pipelines'
6975 const queryParams = new URLSearchParams ( )
7076
7177 if ( params . sort_by ) queryParams . append ( 'sort_by' , params . sort_by )
7278 if ( params . sort_direction ) queryParams . append ( 'sort_direction' , params . sort_direction )
7379 if ( params . limit ) queryParams . append ( 'limit' , params . limit )
74- if ( params . start ) queryParams . append ( 'start ' , params . start )
80+ if ( params . cursor ) queryParams . append ( 'cursor ' , params . cursor )
7581
7682 const queryString = queryParams . toString ( )
7783 return queryString ? `${ baseUrl } ?${ queryString } ` : baseUrl
@@ -89,16 +95,16 @@ export const pipedriveGetPipelinesTool: ToolConfig<
8995 }
9096
9197 const pipelines = data . data || [ ]
92- const hasMore = data . additional_data ?. pagination ?. more_items_in_collection || false
93- const nextStart = data . additional_data ?. pagination ?. next_start ?? null
98+ const nextCursor = data . additional_data ?. next_cursor ?? null
9499
95100 return {
96101 success : true ,
97102 output : {
98103 pipelines,
99104 total_items : pipelines . length ,
100- has_more : hasMore ,
101- next_start : nextStart ,
105+ has_more : nextCursor !== null ,
106+ next_start : null ,
107+ next_cursor : nextCursor ,
102108 success : true ,
103109 } ,
104110 }
@@ -121,7 +127,12 @@ export const pipedriveGetPipelinesTool: ToolConfig<
121127 } ,
122128 next_start : {
123129 type : 'number' ,
124- description : 'Offset for fetching the next page' ,
130+ description : 'Always null: API v2 pages with next_cursor instead of an offset' ,
131+ optional : true ,
132+ } ,
133+ next_cursor : {
134+ type : 'string' ,
135+ description : 'Cursor for fetching the next page' ,
125136 optional : true ,
126137 } ,
127138 success : { type : 'boolean' , description : 'Operation success status' } ,
0 commit comments