-
Notifications
You must be signed in to change notification settings - Fork 0
RHDHPAI-1037: MCP tool to query catalog entities #2
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
Assisted-by: claude-4-sonnet Signed-off-by: John Collier <[email protected]>
CC @gabemontero |
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.
just some minor comments .... yeah the backstage actions framework does provide a nice plug point for registering tools into an mcp server @johnmcollier
List all Backstage entities such as Components, Systems, Resources, APIs, Locations, Users, and Groups. | ||
Results are returned in JSON array format, where each entry in the JSON array has the following fields: 'name', 'description','uid', and 'type'. | ||
|
||
This tool searches through the software catalog to find components the entities. It supports filtering by entity properties and |
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.
to find components the entities
does not parse as grammatically correct to me @johnmcollier but I'm not sure where you were going, so I couldn't just suggest the correction
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.
also down below you got some more precise restrictions on what you can filter on ... i.e. the comment below that starts with Validate that type is only used with kind -- we could just allow 'type' to be specified without 'kind' but given types...
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.
Oops - it should be fixed now, I think some errant copy/pasting messed up the original phrasing.
I've also updated the description to denote the specific requirements on filtering by type
workspaces/mcp-integrations/plugins/backstage-mcp-plugin-backend/src/plugin.ts
Outdated
Show resolved
Hide resolved
} | ||
] | ||
} | ||
`, |
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.
and "end of description" comment might be helpful ... it took me a couple to sort out that schema
was the next field in the parameter passed to the actions registry
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.
Yup, good idea. Updated
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.
oh sorry @johnmcollier in case it was not clear ... .I was thinking a typescript comment after the backtick and before the comma
I don't think you want to include <End of Description>
in the actual description string
make sense?
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.
🤦 Yes, that makes more sense haha. Thanks @gabemontero I've pushed an update that switches it to a comment
…nd/src/plugin.ts Co-authored-by: Gabe Montero <[email protected]> Signed-off-by: John Collier <[email protected]>
Signed-off-by: John Collier <[email protected]>
…plugins into mcpcatalogquery
@gabemontero Thanks for the review! Comments have been addressed in a new commit |
just one minor f/up on the end of description comment I suggested adding @johnmcollier |
Signed-off-by: John Collier <[email protected]>
@gabemontero Thanks Gabe, pushed an update to fix the 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.
lgtm @johnmcollier
Assisted-by: claude-4-sonnet
Hey, I just made a Pull Request!
This PR adds a basic MCP tool using the Backstage MCP plugin framework to enable basic queries against the Backstage catalog:
Kind
type
I've opted to leave text based querying to the MCP client invoking the tool.
In addition to the entity name, the tool also returns the
kind
,type
,description
andtags
for the entity. https://issues.redhat.com/browse/RHDHPAI-1038 will handle more detailed metadata retrieval than what's returned here.I've also prepared a very basic EVAL.md file at the top of the workspace that provides comparison in tool invocations across different models (currently just claude-4-sonnet and llama3.1:8b).
✔️ Checklist
Signed-off-by
line in the message. (more info)