Skip to content

Commit fc531f0

Browse files
Streamline firebase_init prompt (#9219)
* refactor(mcp): streamline firebase_init prompt The `prompt` argument in the `firebase_init` prompt is no longer used and has been removed to simplify the implementation. The "## User Instructions" header has also been removed as it was redundant. Finally, the unreachable short-circuit logic has been removed. * Clean up --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Joe Hanley <[email protected]>
1 parent bbce454 commit fc531f0

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

src/mcp/prompts/core/init.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,18 @@
11
import { getPlatformFromFolder } from "../../../dataconnect/appFinder";
22
import { Platform } from "../../../dataconnect/types";
33
import { prompt } from "../../prompt";
4-
import { init_ai } from "../../resources/guides/init_ai";
5-
import { init_backend } from "../../resources/guides/init_backend";
6-
import { ServerResource } from "../../resource";
7-
8-
const GUIDE_PARAMS: Record<string, ServerResource> = {
9-
"ai-logic": init_ai,
10-
backend: init_backend,
11-
};
124

135
export const init = prompt(
146
{
157
name: "init",
168
description: "Use this command to setup Firebase for the current workspace.",
17-
arguments: [
18-
{
19-
name: "prompt",
20-
description: "any Firebase products you want to use or the problems you're trying to solve",
21-
required: false,
22-
},
23-
],
249
annotations: {
2510
title: "Initialize Firebase",
2611
},
2712
},
28-
async ({ prompt }, mcp) => {
13+
async (_, mcp) => {
2914
const { config, projectId, accountEmail } = mcp;
3015

31-
// This allows a "short circuit" feature where you can pass a specific
32-
// name, like "ai-logic" into the prompt and get a specific guide
33-
const resourceDefinition = prompt ? GUIDE_PARAMS[prompt] : undefined;
34-
if (resourceDefinition) {
35-
const resource = await resourceDefinition.fn(resourceDefinition.mcp.uri, mcp);
36-
return resource.contents
37-
.filter((resContents) => !!resContents.text)
38-
.map((resContents) => ({
39-
role: "user" as const,
40-
content: {
41-
type: "text",
42-
text: String(resContents.text),
43-
},
44-
}));
45-
}
46-
4716
const platform = await getPlatformFromFolder(config.projectDir);
4817

4918
return [
@@ -72,9 +41,6 @@ Contents of \`firebase.json\` config file:
7241
${config.readProjectFile("firebase.json", { fallback: "<FILE DOES NOT EXIST>" })}
7342
\`\`\`
7443
75-
## User Instructions
76-
77-
${prompt || "<the user didn't supply specific instructions>"}
7844
7945
## Steps
8046

0 commit comments

Comments
 (0)