WithCursorPagination adds only cursor-based pagination parameters to a tool (no page parameter).
(schema *jsonschema.Schema)
| 367 | |
| 368 | // WithCursorPagination adds only cursor-based pagination parameters to a tool (no page parameter). |
| 369 | func WithCursorPagination(schema *jsonschema.Schema) *jsonschema.Schema { |
| 370 | schema.Properties["perPage"] = &jsonschema.Schema{ |
| 371 | Type: "number", |
| 372 | Description: "Results per page for pagination (min 1, max 100)", |
| 373 | Minimum: jsonschema.Ptr(1.0), |
| 374 | Maximum: jsonschema.Ptr(100.0), |
| 375 | } |
| 376 | |
| 377 | schema.Properties["after"] = &jsonschema.Schema{ |
| 378 | Type: "string", |
| 379 | Description: "Cursor for pagination. Use the cursor from the previous response.", |
| 380 | } |
| 381 | |
| 382 | return schema |
| 383 | } |
| 384 | |
| 385 | type PaginationParams struct { |
| 386 | Page int |
no outgoing calls
no test coverage detected