Files
sure/db/migrate
Blaž Dular 37301e15ae feat(mcp): add pagination to get_tags and get_categories tools (#2492)
* feat(mcp): add pagination to get_tags and get_categories tools

Both tools now accept a `page` param and return `total_results`,
`total_pages`, `page`, and `page_size` — matching the pattern used
by get_transactions and get_holdings. Adds a migration for composite
(family_id, name) indexes on tags and categories to support efficient
paginated ordering within a family scope.

* fix(mcp): make page param optional in get_tags/get_categories schema and fix migration version

Page defaults to 1 in call() so marking it required in the JSON schema was incorrect.
Also fixes migration to use ActiveRecord::Migration[7.2] instead of [8.0].

* fix: update schema.rb with family_id+name indexes for tags and categories

* fix(mcp): stable pagination sort and unique family/name indexes on tags and categories

- Make family_id+name indexes unique (matches existing AR uniqueness validations)
- Add id tie-breaker to alphabetically/alphabetically_by_hierarchy scopes
  so paginated results are deterministic

* refactor(mcp): replace Pagy::Backend mixin with Pagy.new in model layer

Pagy::Backend is designed for controllers; using it in plain model
classes is fragile. Switch all four assistant functions to call
Pagy.new(count:, page:, limit:) directly and apply offset/limit
on the scope, which is the correct approach for non-controller contexts.
2026-08-12 23:55:05 +02:00
..
2024-02-02 09:05:04 -06:00
2024-02-02 09:05:04 -06:00