Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions workspace-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { PeopleService } from "./services/PeopleService";
import { SlidesService } from "./services/SlidesService";
import { SheetsService } from "./services/SheetsService";
import { GMAIL_SEARCH_MAX_RESULTS } from "./utils/constants";
import { CHAT_FORMATTING, CHAT_FORMATTING_SHORT } from "./utils/formatting/constants";
import { extractDocId } from "./utils/IdUtils";

import { setLoggingEnabled } from "./utils/logger";
Expand Down Expand Up @@ -455,10 +456,10 @@ async function main() {
server.registerTool(
"chat.sendMessage",
{
description: 'Sends a message to a Google Chat space.',
description: `Sends a message to a Google Chat space. ${CHAT_FORMATTING}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try adding these to the GEMINI-workspace.md file? It seems like a little overkill to add these to every tool description, but if you tried that and it didn't work I would understand why you took this route.

Copy link
Contributor Author

@kamladi kamladi Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created pull/142 which only updates WORKSPACE-Context.md, I can close this PR once the new one is merged.

inputSchema: {
spaceName: z.string().describe('The name of the space to send the message to (e.g., spaces/AAAAN2J52O8).'),
message: z.string().describe('The message to send.'),
message: z.string().describe(`The message to send. ${CHAT_FORMATTING_SHORT}`),
}
},
chatService.sendMessage
Expand All @@ -482,10 +483,10 @@ async function main() {
server.registerTool(
"chat.sendDm",
{
description: 'Sends a direct message to a user.',
description: `Sends a direct message to a user. ${CHAT_FORMATTING}`,
inputSchema: {
email: z.string().email().describe('The email address of the user to send the message to.'),
message: z.string().describe('The message to send.'),
message: z.string().describe(`The message to send. ${CHAT_FORMATTING_SHORT}`),
}
},
chatService.sendDm
Expand Down
28 changes: 28 additions & 0 deletions workspace-server/src/utils/formatting/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export const CHAT_FORMATTING_SHORT = [

Check failure on line 1 in workspace-server/src/utils/formatting/constants.ts

View workflow job for this annotation

GitHub Actions / test (20.x, macos-latest)

Missing license header

Check failure on line 1 in workspace-server/src/utils/formatting/constants.ts

View workflow job for this annotation

GitHub Actions / test (22.x, ubuntu-latest)

Missing license header

Check failure on line 1 in workspace-server/src/utils/formatting/constants.ts

View workflow job for this annotation

GitHub Actions / test (24.x, ubuntu-latest)

Missing license header

Check failure on line 1 in workspace-server/src/utils/formatting/constants.ts

View workflow job for this annotation

GitHub Actions / test (20.x, ubuntu-latest)

Missing license header

Check failure on line 1 in workspace-server/src/utils/formatting/constants.ts

View workflow job for this annotation

GitHub Actions / test (24.x, macos-latest)

Missing license header
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a license header here to clear lint. If you run npm run lint:fix it should do the right thing.

'Google Chat formatting (not standard Markdown):',
'*bold* (single asterisk), _italic_ (single underscore),',
'~strikethrough~, `code`, bulleted lists ("* " or "- "),',
'<url|text> links, <users/{user}> mentions.',
'No nested lists: use "- -- child" for depth.',
'Convert: **bold** → *bold*, *italic* → _italic_, [text](url) → <url|text>.',
'# headings and > blockquotes are also unsupported syntax.',
].join(' ');

export const CHAT_FORMATTING = `
Supported formatting:
- *bold* (single asterisks)
- _italic_ (single underscores)
- ~strikethrough~
- \`inline code\`
- \`\`\`code blocks\`\`\`
- Bulleted lists ("* " or "- " at line start)
- Links: <url|text>
- User mentions: <users/{user}>
Unsupported (convert these):
- **double asterisks** for bold
- [text](url) markdown links
- Nested lists (flatten with dashes: "- parent", "- -- child")
- # headings
- > blockquotes
`.trim();
Loading