Skip to content

Commit 1c51856

Browse files
authored
chore(mcp): Polish up descriptions and titles. (#8608)
1 parent 04bee78 commit 1c51856

26 files changed

+181
-126
lines changed

src/mcp/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { loadRC } from "../rc.js";
2323
import { EmulatorHubClient } from "../emulator/hubClient.js";
2424
import { existsSync } from "node:fs";
2525

26-
const SERVER_VERSION = "0.0.1";
26+
const SERVER_VERSION = "0.1.0";
2727

2828
const cmd = new Command("experimental:mcp").before(requireAuth);
2929

src/mcp/tools/auth/get_user.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,25 @@ export const get_user = tool(
88
name: "get_user",
99
description: "Retrieves a user based on an email address, phone number, or UID.",
1010
inputSchema: z.object({
11-
email: z.string().optional(),
12-
phone_number: z.string().optional(),
13-
uid: z.string().optional(),
11+
email: z
12+
.string()
13+
.optional()
14+
.describe(
15+
"The user's email address. At least one of email, phone_number, or uid must be provided.",
16+
),
17+
phone_number: z
18+
.string()
19+
.optional()
20+
.describe(
21+
"The user's phone number. At least one of email, phone_number, or uid must be provided.",
22+
),
23+
uid: z
24+
.string()
25+
.optional()
26+
.describe("The user's UID. At least one of email, phone_number, or uid must be provided."),
1427
}),
1528
annotations: {
16-
title: "Get information about 1 user.",
29+
title: "Get Firebase Auth User",
1730
readOnlyHint: true,
1831
},
1932
_meta: {

src/mcp/tools/auth/list_users.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ export const list_users = tool(
88
name: "list_users",
99
description: "Retrieves all users in the project up to the specified limit.",
1010
inputSchema: z.object({
11-
limit: z.number().optional().default(100).describe("The number of users to return"),
11+
limit: z
12+
.number()
13+
.optional()
14+
.default(100)
15+
.describe("The number of users to return. Defaults to 100 if not supplied."),
1216
}),
1317
annotations: {
14-
title: "Get users from the Firebase project.",
18+
title: "List Firebase Users",
1519
readOnlyHint: true,
1620
},
1721
_meta: {
@@ -24,6 +28,13 @@ export const list_users = tool(
2428
limit = 100;
2529
}
2630

27-
return toContent(await listUsers(projectId!, limit));
31+
const users = await listUsers(projectId!, limit);
32+
const usersPruned = users.map((user) => {
33+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
34+
const { passwordHash, salt, ...prunedUser } = user;
35+
return prunedUser;
36+
});
37+
38+
return toContent(usersPruned);
2839
},
2940
);

src/mcp/tools/auth/set_claims.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@ import { setCustomClaim } from "../../../gcp/auth.js";
55

66
export const set_claim = tool(
77
{
8-
name: "set_claims",
8+
name: "set_claim",
99
description:
10-
"Sets custom claims on a specific user's account. Use to create trusted values associated with a user e.g. marking them as an admin. Claims are limited in size and should be succinct in name and value. Specify ONLY ONE OF `value` or `json_value` parameters.",
10+
"Sets a custom claim on a specific user's account. Use to create trusted values associated with a user e.g. marking them as an admin. Claims are limited in size and should be succinct in name and value. Specify ONLY ONE OF `value` or `json_value` parameters.",
1111
inputSchema: z.object({
1212
uid: z.string().describe("the UID of the user to update"),
1313
claim: z.string().describe("the name (key) of the claim to update, e.g. 'admin'"),
1414
value: z
1515
.union([z.string(), z.number(), z.boolean()])
1616
.optional()
17-
.describe("set the value of the custom claim to the specified simple scalar value"),
17+
.describe(
18+
"Set the value of the custom claim to the specified simple scalar value. One of `value` or `json_value` must be provided.",
19+
),
1820
json_value: z
1921
.string()
2022
.optional()
2123
.describe(
22-
"set the claim to a complex JSON value like an object or an array by providing stringified JSON. string must be parseable as valid JSON",
24+
"Set the claim to a complex JSON value like an object or an array by providing stringified JSON. String must be parseable as valid JSON. One of `value` or `json_value` must be provided.",
2325
),
2426
}),
2527
annotations: {

src/mcp/tools/auth/set_sms_region_policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const set_sms_region_policy = tool(
1919
.describe("the country codes to allow or deny based on ISO 3166"),
2020
}),
2121
annotations: {
22-
title: "Set the SMS Region Policy on your Firebase Project",
22+
title: "Set SMS Region Policy",
2323
idempotentHint: true,
2424
destructiveHint: true,
2525
},

src/mcp/tools/core/consult_assistant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const consult_assistant = tool(
1414
.describe("A description of what the user is trying to do or learn with Firebase."),
1515
}),
1616
annotations: {
17-
title: "Helps answer queries and provide information related to Firebase.",
17+
title: "Consult Firebase Assistant",
1818
readOnlyHint: true,
1919
},
2020
_meta: {

src/mcp/tools/core/create_app.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ export const create_app = tool(
1212
name: "create_app",
1313
description: "Creates a new app in your Firebase project for Web, iOS, or Android.",
1414
inputSchema: z.object({
15-
display_name: z.string().optional().describe("The user-friendly display name for your app."),
15+
display_name: z
16+
.string()
17+
.optional()
18+
.describe(
19+
"The user-friendly display name for your app. If not provided, a default name may be generated.",
20+
),
1621
platform: z
1722
.enum(["web", "ios", "android"])
1823
.describe("The platform for which to create an app."),
@@ -23,22 +28,19 @@ export const create_app = tool(
2328
.describe("The package name for your Android app (e.g., com.example.myapp)."),
2429
})
2530
.optional()
26-
.describe("Configuration for Android apps."),
31+
.describe("Configuration for Android apps. Required if platform is 'android'."),
2732
ios_config: z
2833
.object({
2934
bundle_id: z
3035
.string()
3136
.describe("The bundle ID for your iOS app (e.g., com.example.myapp)."),
32-
app_store_id: z
33-
.string()
34-
.optional()
35-
.describe("The App Store ID for your iOS app (optional)."),
37+
app_store_id: z.string().optional().describe("The App Store ID for your iOS app."),
3638
})
3739
.optional()
38-
.describe("Configuration for iOS apps."),
40+
.describe("Configuration for iOS apps. Required if platform is 'ios'."),
3941
}),
4042
annotations: {
41-
title: "Create App",
43+
title: "Create Firebase App",
4244
destructiveHint: false,
4345
readOnlyHint: false,
4446
},

src/mcp/tools/core/create_project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function checkCloudProject(projectId: string): Promise<ProjectInfo | undef
2727
export const create_project = tool(
2828
{
2929
name: "create_project",
30-
description: "Creates a new Firebase project or returns an existing one.",
30+
description: "Creates a new Firebase project.",
3131
inputSchema: z.object({
3232
project_id: z.string().describe("The project ID to create or use."),
3333
display_name: z

src/mcp/tools/core/get_sdk_config.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ export const get_sdk_config = tool(
1111
inputSchema: z.object({
1212
platform: z
1313
.enum(["ios", "android", "web"])
14-
.nullish()
15-
.describe("the platform for which you want config"),
16-
app_id: z.string().nullish().describe("the specific app id to fetch"),
14+
.optional()
15+
.describe(
16+
"The platform for which you want config. One of 'platform' or 'app_id' must be provided.",
17+
),
18+
app_id: z
19+
.string()
20+
.optional()
21+
.describe("The specific app ID to fetch. One of 'platform' or 'app_id' must be provided."),
1722
}),
1823
annotations: {
1924
title: "Get Firebase SDK Config",

src/mcp/tools/core/init.ts

Lines changed: 68 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -8,69 +8,76 @@ export const init = tool(
88
{
99
name: "init",
1010
description:
11-
"Setup the Firebase workspace and initialize selected features." +
12-
" It takes a feature map that describe each desired product. All the features are optional." +
13-
" Provide only requested products.",
11+
"Initializes selected Firebase features in the workspace. All features are optional; provide only the products you wish to set up. You can initialize new features into an existing project directory, but re-initializing an existing feature may overwrite configuration.",
1412
inputSchema: z.object({
15-
// force: z
16-
// .boolean()
17-
// .default(false)
18-
// .describe("Force the initialization without prompting for confirmation. Without force, it prompts if any existing files are overwritten."),
1913
features: z.object({
20-
database: z.object({
21-
rules_filename: z
22-
.string()
23-
.optional()
24-
.default("database.rules.json")
25-
.describe("The file to use for Realtime Database Security Rules."),
26-
rules: z
27-
.string()
28-
.optional()
29-
.default(DEFAULT_RULES)
30-
.describe("The security rules to use for Realtime Database Security Rules."),
31-
}),
32-
firestore: z.object({
33-
database_id: z
34-
.string()
35-
.optional()
36-
.default("(default)")
37-
.describe("The database ID to use for Firestore."),
38-
rules_filename: z
39-
.string()
40-
.optional()
41-
.default("firestore.rules")
42-
.describe("The file to use for Firestore Security Rules."),
43-
rules: z
44-
.string()
45-
.optional()
46-
.describe(
47-
"The security rules to use for Firestore Security Rules. Default to open rules that expire in 30 days.",
48-
),
49-
}),
50-
dataconnect: z.object({
51-
service_id: z
52-
.string()
53-
.optional()
54-
.describe(
55-
"The Firebase Data Connect service ID to initialize. Default to match the current folder name.",
56-
),
57-
location_id: z
58-
.string()
59-
.optional()
60-
.default("us-central1")
61-
.describe("The GCP region ID to set up the Firebase Data Connect service."),
62-
cloudsql_instance_id: z
63-
.string()
64-
.optional()
65-
.describe(
66-
"The GCP Cloud SQL instance ID to use in the Firebase Data Connect service. By default, use <serviceId>-fdc.",
67-
),
68-
cloudsql_database: z
69-
.string()
70-
.optional()
71-
.default("fdcdb")
72-
.describe("The Postgres database ID to use in the Firebase Data Connect service."),
73-
}),
14+
database: z
15+
.object({
16+
rules_filename: z
17+
.string()
18+
.optional()
19+
.default("database.rules.json")
20+
.describe("The file to use for Realtime Database Security Rules."),
21+
rules: z
22+
.string()
23+
.optional()
24+
.default(DEFAULT_RULES)
25+
.describe("The security rules to use for Realtime Database Security Rules."),
26+
})
27+
.optional()
28+
.describe(
29+
"Provide this object to initialize Firebase Realtime Database in this project directory.",
30+
),
31+
firestore: z
32+
.object({
33+
database_id: z
34+
.string()
35+
.optional()
36+
.default("(default)")
37+
.describe("The database ID to use for Firestore."),
38+
rules_filename: z
39+
.string()
40+
.optional()
41+
.default("firestore.rules")
42+
.describe("The file to use for Firestore Security Rules."),
43+
rules: z
44+
.string()
45+
.optional()
46+
.describe(
47+
"The security rules to use for Firestore Security Rules. Default to open rules that expire in 30 days.",
48+
),
49+
})
50+
.optional()
51+
.describe("Provide this object to initialize Cloud Firestore in this project directory."),
52+
dataconnect: z
53+
.object({
54+
service_id: z
55+
.string()
56+
.optional()
57+
.describe(
58+
"The Firebase Data Connect service ID to initialize. Default to match the current folder name.",
59+
),
60+
location_id: z
61+
.string()
62+
.optional()
63+
.default("us-central1")
64+
.describe("The GCP region ID to set up the Firebase Data Connect service."),
65+
cloudsql_instance_id: z
66+
.string()
67+
.optional()
68+
.describe(
69+
"The GCP Cloud SQL instance ID to use in the Firebase Data Connect service. By default, use <serviceId>-fdc.",
70+
),
71+
cloudsql_database: z
72+
.string()
73+
.optional()
74+
.default("fdcdb")
75+
.describe("The Postgres database ID to use in the Firebase Data Connect service."),
76+
})
77+
.optional()
78+
.describe(
79+
"Provide this object to initialize Firebase Data Connect in this project directory.",
80+
),
7481
}),
7582
}),
7683
annotations: {

src/mcp/tools/core/update_environment.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const update_environment = tool(
2121
.string()
2222
.optional()
2323
.describe(
24-
"Change the active project for the current project directory. Should be a Firbase project ID or configured project alias.",
24+
"Change the active project for the current project directory. Should be a Firebase project ID or configured project alias.",
2525
),
2626
active_user_account: z
2727
.string()
@@ -31,8 +31,8 @@ export const update_environment = tool(
3131
),
3232
}),
3333
annotations: {
34-
title: "Get Current Firebase Project",
35-
readOnlyHint: true,
34+
title: "Update Firebase Environment",
35+
readOnlyHint: false,
3636
},
3737
_meta: {
3838
requiresAuth: false,

src/mcp/tools/dataconnect/execute_graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const execute_graphql = tool(
2828
use_emulator: z.boolean().default(false).describe("Target the DataConnect emulator if true."),
2929
}),
3030
annotations: {
31-
title: "Executes a arbitrary GraphQL query or mutation against a Data Connect service",
31+
title: "Execute GraphQL Operation",
3232
readOnlyHint: false,
3333
},
3434
_meta: {

src/mcp/tools/dataconnect/execute_graphql_read.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const execute_graphql_read = tool(
2929
use_emulator: z.boolean().default(false).describe("Target the DataConnect emulator if true."),
3030
}),
3131
annotations: {
32-
title: "Executes a arbitrary GraphQL query against a Data Connect service",
32+
title: "Execute Data Connect GraphQL Query",
3333
readOnlyHint: true,
3434
},
3535
_meta: {

src/mcp/tools/dataconnect/execute_mutation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const execute_mutation = tool(
3636
use_emulator: z.boolean().default(false).describe("Target the DataConnect emulator if true."),
3737
}),
3838
annotations: {
39-
title: "Executes a deployed Data Connect query or mutation",
39+
title: "Execute Data Connect Connector Mutation",
4040
readOnlyHint: false,
4141
},
4242
_meta: {

src/mcp/tools/dataconnect/generate_operation.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const generate_operation = tool(
1414
prompt: z
1515
.string()
1616
.describe(
17-
"Write the prompt like you're talking to a person, describe the task you're trying to accomplish and give details that are specific to the users requst",
17+
"Write the prompt like you're talking to a person, describe the task you're trying to accomplish and give details that are specific to the users request",
1818
),
1919
service_id: z
2020
.string()
@@ -24,8 +24,7 @@ export const generate_operation = tool(
2424
),
2525
}),
2626
annotations: {
27-
title:
28-
"Generate a Firebase Data Connect Operation on a deployed Firebase Data Connect Schema.",
27+
title: "Generate Data Connect Operation",
2928
readOnlyHint: true,
3029
},
3130
_meta: {

src/mcp/tools/dataconnect/generate_schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const generate_schema = tool(
1212
prompt: z.string().describe("A description of an app that you are interested in building"),
1313
}),
1414
annotations: {
15-
title: "Generate a Firebase Data Connect Schema for a new Firebase project.",
15+
title: "Generate Data Connect Schema",
1616
readOnlyHint: true,
1717
},
1818
_meta: {

0 commit comments

Comments
 (0)