-
Notifications
You must be signed in to change notification settings - Fork 1k
initial apphosting mcp tool #8605
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
base: master
Are you sure you want to change the base?
Conversation
if (!projectId) return NO_PROJECT_ERROR; | ||
if (!location) location = "-"; | ||
const data: (Backend & { traffic: Traffic })[] = []; | ||
const backends = await listBackends(projectId, location); |
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.
We might want a different message for no backends - ie
const backends = await listBackends(projectId, location); | |
const backends = await listBackends(projectId, location); | |
if (!backends.length) return toContent("No backends exist on project ${projectId} ${location !== "-" ? `in ${location}` :""} |
Not sure what the LLMs will like more
}, | ||
}, | ||
async ({ location } = {}, { projectId }) => { | ||
if (!projectId) return NO_PROJECT_ERROR; |
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.
This is already taken care of by the caller.
firebase-tools/src/mcp/index.ts
Line 189 in 214d190
if (tool.mcp._meta?.requiresProject && !projectId) return NO_PROJECT_ERROR; |
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.
Sure, but I still have to assert that projectId isn't undefined, otherwise I have to do checks all over the place. Does this hurt that much to bother?
Description
Adds an initial MCP tool for App Hosting.
This combines the Backend and it's singleton Traffic resource into one so that the LLM can make some inferences about the traffic information!
Scenarios Tested
Sample Commands