-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy patherrors.ts
More file actions
24 lines (22 loc) · 1.18 KB
/
errors.ts
File metadata and controls
24 lines (22 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
import { mcpError } from "./util";
export const NO_PROJECT_ERROR = mcpError(
"To proceed requires an active project. Use the `firebase_update_environment` tool to set a project ID",
"PRECONDITION_FAILED",
);
export function noProjectDirectory(projectRoot: string | undefined): CallToolResult {
return mcpError(
`The current project directory '${
projectRoot || "<NO PROJECT DIRECTORY FOUND>"
}' does not exist. Please use the 'update_firebase_environment' tool to target a different project directory.`,
);
}
export function mcpAuthError(skipADC: boolean): CallToolResult {
if (skipADC) {
return mcpError(
`The user is not currently logged into the Firebase CLI, which is required to use this tool. Please run the 'firebase_login' tool to log in.`,
);
}
return mcpError(`The user is not currently logged into the Firebase CLI, which is required to use this tool. Please run the 'firebase_login' tool to log in, or instruct the user to configure [Application Default Credentials][ADC] on their machine.
[ADC]: https://cloud.google.com/docs/authentication/application-default-credentials`);
}