mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-25 12:34:38 -07:00
feat(telemetry): Add context breakdown to API response event (#19699)
This commit is contained in:
@@ -29,6 +29,16 @@ import type { MessageBus } from '../confirmation-bus/message-bus.js';
|
||||
*/
|
||||
export const MCP_QUALIFIED_NAME_SEPARATOR = '__';
|
||||
|
||||
/**
|
||||
* Returns true if `name` matches the MCP qualified name format: "server__tool",
|
||||
* i.e. exactly two non-empty parts separated by the MCP_QUALIFIED_NAME_SEPARATOR.
|
||||
*/
|
||||
export function isMcpToolName(name: string): boolean {
|
||||
if (!name.includes(MCP_QUALIFIED_NAME_SEPARATOR)) return false;
|
||||
const parts = name.split(MCP_QUALIFIED_NAME_SEPARATOR);
|
||||
return parts.length === 2 && parts[0].length > 0 && parts[1].length > 0;
|
||||
}
|
||||
|
||||
type ToolParams = Record<string, unknown>;
|
||||
|
||||
// Discriminated union for MCP Content Blocks to ensure type safety.
|
||||
|
||||
Reference in New Issue
Block a user