Skip to main content
Glama

Vertex AI MCP Server

tool_definition.ts1.18 kB
import { McpError, ErrorCode } from "@modelcontextprotocol/sdk/types.js"; import type { Content, Tool } from "@google/genai"; export interface ToolDefinition { name: string; description: string; inputSchema: any; // Consider defining a stricter type like JSONSchema7 buildPrompt: (args: any, modelId: string) => { systemInstructionText: string; userQueryText: string; useWebSearch: boolean; enableFunctionCalling: boolean; }; } export const modelIdPlaceholder = "${modelId}"; // Placeholder for dynamic model ID in descriptions // Helper to build the initial content array export function buildInitialContent(systemInstruction: string, userQuery: string): Content[] { return [{ role: "user", parts: [{ text: `${systemInstruction}\n\n${userQuery}` }] }]; } // Helper to determine tools for API call export function getToolsForApi(enableFunctionCalling: boolean, useWebSearch: boolean): Tool[] | undefined { // Function calling is no longer supported by the remaining tools return useWebSearch ? [{ googleSearch: {} } as any] : undefined; // Cast needed as SDK type might not include googleSearch directly }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shariqriazz/vertex-ai-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server