-
Couldn't load subscription status.
- Fork 5
EN-584 - update the SKD and use new variant filter endpoint #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EN-584 - update the SKD and use new variant filter endpoint #40
Conversation
b6540cd to
9392843
Compare
src/tools/filter-variants-mapi.ts
Outdated
| .withAction(`projects/${environmentId}/early-access/variants/filter`) | ||
| .withData(requestPayload) | ||
| .toPromise(); | ||
| const response = await query.toPromise(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to use the same approach as in other listing tools? Something like in list-assets-mapi for example? Meaning using toAllPromise. That way the AI agent doesn't need to know about paging and continuation tokens...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know the toAllPromise() SDK method, I will fix that :-)
package.json
Outdated
| "license": "MIT", | ||
| "dependencies": { | ||
| "@kontent-ai/management-sdk": "^7.9.0", | ||
| "@kontent-ai/management-sdk": "^7.11.0-4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that after we approve the PR for the SDK, Risa is going to release new version (not pre-release). That means we should probably wait for that...
ba274f0 to
036d44a
Compare
README.md
Outdated
| * **create-variant-version-mapi** – Create new version of Kontent.ai language variant via Management API. This operation creates a new version of an existing language variant, useful for content versioning and creating new drafts from published content | ||
| * **delete-language-variant-mapi** – Delete Kontent.ai language variant from Management API | ||
| * **filter-variants-mapi** – Filter Kontent.ai language variants of content items using Management API. Use for exact keyword matching and finding specific terms in content. Supports full filtering capabilities (content types, workflow steps, taxonomies, etc.) | ||
| * **filter-variants-mapi** – Filter Kontent.ai language variants of content items using Management API. Use for exact keyword matching and finding specific terms in content. Supports full filtering capabilities (content types, workflow steps, taxonomies, etc.), pagination with continuation tokens, and optionally includes full content of variants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't confuse the AI agent with any continuation tokens anymore :)
src/tools/filter-variants-mapi.ts
Outdated
| const allItems = response.responses.flatMap((r) => r.rawData.data); | ||
|
|
||
| return createMcpToolSuccessResponse(response.data); | ||
| return createMcpToolSuccessResponse({ data: allItems }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to return an object instead of the array of all items?
036d44a to
01dd42f
Compare
Motivation
Which issue does this fix? Fixes #
issue numberIf no issue exists, what is the fix or new feature? Were there any reasons to fix/implement things that are not obvious?
Checklist
How to test
If manual testing is required, what are the steps?