-
Notifications
You must be signed in to change notification settings - Fork 33
Register some utility Abilities #86
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
Conversation
…get content from a post
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #86 +/- ##
=============================================
- Coverage 39.76% 29.75% -10.01%
- Complexity 107 136 +29
=============================================
Files 12 14 +2
Lines 591 830 +239
=============================================
+ Hits 235 247 +12
- Misses 356 583 +227
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
HI @dkotter! This is a partial review. I'm curious why you decided to have a bunch of small abilities as opposed to a single get-post-details ability (the terms ability would still be separate)?
Also, let's add the meta parameter so this available via MCP.
I went back and forth on this so happy to change this up (mentioned in the PR description):
Main thought was keeping these separate allow you to choose what details you want instead of just getting everything but also feels overcomplicated so I can change that to be a |
|
@JasonTheAdams Modified things now to have two abilities:
Can you point me to what parameter this needs? I'm not seeing anything in looking through the documentation for the Abilities API or MCP Adapter but likely just missing it |
JasonTheAdams
left a comment
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.
Yeah, this is better, @dkotter!
Also, here's the doc on how to connect an Ability to MCP: https://github.com/WordPress/mcp-adapter/blob/trunk/docs/guides/creating-abilities.md
…mies that exist, that are allowed in REST requests and that are associated with the post object we want
Ah, thanks for that. The main readme in that repo claims:
So wasn't sure we needed to do anything else. Added this in 78e35e0 |
JasonTheAdams
left a comment
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.
Great work, @dkotter! LGTM! 🎉
What?
Adds in two new, what I'm calling "Utility Abilities" (open to naming suggestions). These are more simple Abilities as compared to our current Title Generation Ability. These take in a post ID and will return some information about that post, like title, content, author or terms. We then use these Abilities when building our post context.
Why?
While this does make our code slightly more complex and isn't the approach I'd generally take, adding these in does accomplish a few things:
I originally had individual Abilities for each piece of context (like post content, post title, post author, etc) but after some feedback, trimmed it down to two Abilities, one to get all post details (which you can optionally filter to just the fields you want) and one to get all post terms (which you can also filter to just the taxonomies you want).
How?
Utilities, that registers two new abilities:get-post-detailsandget-post-tems. These Abilities aren't currently registered with the REST APIget_post_contexthelper function to instead use these new Abilities to build up that contextTesting Instructions
There isn't any UI yet to trigger things so you'd have to make a direct request to the Title Generation Abilities endpoint to see these in action