MCP Tools Reference: aiplatform.googleapis.com

Tool: predict

Perform online predictions for a wide range of machine learning models. Use this to get real-time inference results from your deployed models on Vertex AI.

The following sample demonstrate how to use curl to invoke the predict MCP tool.

Curl Request
  
curl  
--location  
 'https://aiplatform.googleapis.com/mcp/generate' 
  
 \ 
--header  
 'content-type: application/json' 
  
 \ 
--header  
 'accept: application/json, text/event-stream' 
  
 \ 
--data  
 '{ 
 "method": "tools/call", 
 "params": { 
 "name": "predict", 
 "arguments": { 
 // provide these details according to the tool' 
s  
MCP  
specification  
 } 
  
 } 
,  
 "jsonrpc" 
:  
 "2.0" 
,  
 "id" 
:  
 1 
 } 
 ' 
  

Input Schema

Request message for PredictionService.Predict .

PredictRequest

JSON representation
 { 
 "endpoint" 
 : 
 string 
 , 
 "instances" 
 : 
 [ 
 value 
 ] 
 , 
 "parameters" 
 : 
 value 
 , 
 "labels" 
 : 
 { 
 string 
 : 
 string 
 , 
 ... 
 } 
 } 
Fields
endpoint

string

Required. The name of the Endpoint requested to serve the prediction. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

instances[]

value ( Value format)

Required. The instances that are the input to the prediction call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint's DeployedModels' Model's PredictSchemata's instance_schema_uri .

parameters

value ( Value format)

The parameters that govern the prediction. The schema of the parameters may be specified via Endpoint's DeployedModels' Model's PredictSchemata's parameters_schema_uri .

labels

map (key: string, value: string)

Optional. The user labels for Imagen billing usage only. Only Imagen supports labels. For other use cases, it will be ignored.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

Value

JSON representation
 { 
 // Union field kind 
can be only one of the following: 
 "nullValue" 
 : 
 null 
 , 
 "numberValue" 
 : 
 number 
 , 
 "stringValue" 
 : 
 string 
 , 
 "boolValue" 
 : 
 boolean 
 , 
 "structValue" 
 : 
 { 
 object 
 } 
 , 
 "listValue" 
 : 
 array 
 // End of list of possible types for union field kind 
. 
 } 
Fields
Union field kind . The kind of value. kind can be only one of the following:
nullValue

null

Represents a JSON null .

numberValue

number

Represents a JSON number. Must not be NaN , Infinity or -Infinity , since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type.

stringValue

string

Represents a JSON string.

boolValue

boolean

Represents a JSON boolean ( true or false literal in JSON).

structValue

object ( Struct format)

Represents a JSON object.

listValue

array ( ListValue format)

Represents a JSON array.

Struct

JSON representation
 { 
 "fields" 
 : 
 { 
 string 
 : 
 value 
 , 
 ... 
 } 
 } 
Fields
fields

map (key: string, value: value ( Value format))

Unordered map of dynamically typed values.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

FieldsEntry

JSON representation
 { 
 "key" 
 : 
 string 
 , 
 "value" 
 : 
 value 
 } 
Fields
key

string

value

value ( Value format)

ListValue

JSON representation
 { 
 "values" 
 : 
 [ 
 value 
 ] 
 } 
Fields
values[]

value ( Value format)

Repeated field of dynamically typed values.

LabelsEntry

JSON representation
 { 
 "key" 
 : 
 string 
 , 
 "value" 
 : 
 string 
 } 
Fields
key

string

value

string

Output Schema

Response message for PredictionService.Predict .

PredictResponse

JSON representation
 { 
 "predictions" 
 : 
 [ 
 value 
 ] 
 , 
 "deployedModelId" 
 : 
 string 
 , 
 "model" 
 : 
 string 
 , 
 "modelVersionId" 
 : 
 string 
 , 
 "modelDisplayName" 
 : 
 string 
 , 
 "metadata" 
 : 
 value 
 } 
Fields
predictions[]

value ( Value format)

The predictions that are the output of the predictions call. The schema of any single prediction may be specified via Endpoint's DeployedModels' Model's PredictSchemata's prediction_schema_uri .

deployedModelId

string

ID of the Endpoint's DeployedModel that served this prediction.

model

string

Output only. The resource name of the Model which is deployed as the DeployedModel that this prediction hits.

modelVersionId

string

Output only. The version ID of the Model which is deployed as the DeployedModel that this prediction hits.

modelDisplayName

string

Output only. The display name of the Model which is deployed as the DeployedModel that this prediction hits.

metadata

value ( Value format)

Output only. Request-level metadata returned by the model. The metadata type will be dependent upon the model implementation.

Value

JSON representation
 { 
 // Union field kind 
can be only one of the following: 
 "nullValue" 
 : 
 null 
 , 
 "numberValue" 
 : 
 number 
 , 
 "stringValue" 
 : 
 string 
 , 
 "boolValue" 
 : 
 boolean 
 , 
 "structValue" 
 : 
 { 
 object 
 } 
 , 
 "listValue" 
 : 
 array 
 // End of list of possible types for union field kind 
. 
 } 
Fields
Union field kind . The kind of value. kind can be only one of the following:
nullValue

null

Represents a JSON null .

numberValue

number

Represents a JSON number. Must not be NaN , Infinity or -Infinity , since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type.

stringValue

string

Represents a JSON string.

boolValue

boolean

Represents a JSON boolean ( true or false literal in JSON).

structValue

object ( Struct format)

Represents a JSON object.

listValue

array ( ListValue format)

Represents a JSON array.

Struct

JSON representation
 { 
 "fields" 
 : 
 { 
 string 
 : 
 value 
 , 
 ... 
 } 
 } 
Fields
fields

map (key: string, value: value ( Value format))

Unordered map of dynamically typed values.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

FieldsEntry

JSON representation
 { 
 "key" 
 : 
 string 
 , 
 "value" 
 : 
 value 
 } 
Fields
key

string

value

value ( Value format)

ListValue

JSON representation
 { 
 "values" 
 : 
 [ 
 value 
 ] 
 } 
Fields
values[]

value ( Value format)

Repeated field of dynamically typed values.

Tool Annotations

Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ✅

Create a Mobile Website
View Site in Mobile | Classic
Share by: