Tool: get_tuning_job
Retrieves the full metadata and current status for a specific GenAI tuning job. This includes details about the base model being tuned, the tuning dataset, hyperparameters, and the resulting tuned model if the job has completed successfully. Use this to check if a model has finished fine-tuning and is ready for deployment. Format: 'projects/{project_id}/locations/{region}'. CRITICAL: For {region}, use the region specified in the current context window. If no region is specified, prompt the user to provide one. Do not use 'global'. IMPORTANT: This parameter requires the 19-digit numeric ID returned by the list tool. If a shorter ID is provided, clarify the resource type or request the full ID before attempting discovery across other service types.
The following sample demonstrate how to use curl
to invoke the get_tuning_job
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": "get_tuning_job", "arguments": { // provide these details according to the tool' s MCP specification } } , "jsonrpc" : "2.0" , "id" : 1 } ' |
Input Schema
Request message for GenAiTuningService.GetTuningJob
.
GetTuningJobRequest
| JSON representation |
|---|
{ "name" : string } |
| Fields | |
|---|---|
name
|
Required. The name of the tuning job to retrieve. Format: |
Output Schema
Represents a TuningJob that runs with Google owned models.
TuningJob
| JSON representation |
|---|
{ "name" : string , "tunedModelDisplayName" : string , "description" : string , "state" : enum ( |
name
string
Output only. Identifier. Resource name of a TuningJob. Format: projects/{project}/locations/{location}/tuningJobs/{tuning_job}
tunedModelDisplayName
string
Optional. The display name of the TunedModel
. The name can be up to 128 characters long and can consist of any UTF-8 characters. For continuous tuning, tuned_model_display_name will by default use the same display name as the pre-tuned model. If a new display name is provided, the tuning job will create a new model instead of a new version.
description
string
Optional. The description of the TuningJob
.
state
enum (
JobState
)
Output only. The detailed state of the job.
createTime
string (
Timestamp
format)
Output only. Time when the TuningJob
was created.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z"
, "2014-10-02T15:01:23.045123456Z"
or "2014-10-02T15:01:23+05:30"
.
startTime
string (
Timestamp
format)
Output only. Time when the TuningJob
for the first time entered the JOB_STATE_RUNNING
state.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z"
, "2014-10-02T15:01:23.045123456Z"
or "2014-10-02T15:01:23+05:30"
.
endTime
string (
Timestamp
format)
Output only. Time when the TuningJob entered any of the following JobStates
: JOB_STATE_SUCCEEDED
, JOB_STATE_FAILED
, JOB_STATE_CANCELLED
, JOB_STATE_EXPIRED
.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z"
, "2014-10-02T15:01:23.045123456Z"
or "2014-10-02T15:01:23+05:30"
.
updateTime
string (
Timestamp
format)
Output only. Time when the TuningJob
was most recently updated.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z"
, "2014-10-02T15:01:23.045123456Z"
or "2014-10-02T15:01:23+05:30"
.
error
object (
Status
)
Output only. Only populated when job's state is JOB_STATE_FAILED
or JOB_STATE_CANCELLED
.
labels
map (key: string, value: string)
Optional. The labels with user-defined metadata to organize TuningJob
and generated resources such as Model
and Endpoint
.
Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed.
See https://goo.gl/xmQnxf for more information and examples of labels.
An object containing a list of "key": value
pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }
.
experiment
string
Output only. The Experiment associated with this TuningJob
.
tunedModel
object (
TunedModel
)
Output only. The tuned model resources associated with this TuningJob
.
tuningDataStats
object (
TuningDataStats
)
Output only. The tuning data statistics associated with this TuningJob
.
encryptionSpec
object (
EncryptionSpec
)
Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.
serviceAccount
string
The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent
Users starting the pipeline must have the iam.serviceAccounts.actAs
permission on this service account.
Union field source_model
.
source_model
can be only one of the following:
baseModel
string
The base model that is being tuned. See Supported models .
preTunedModel
object (
PreTunedModel
)
The pre-tuned model for continuous tuning.
Union field tuning_spec
.
tuning_spec
can be only one of the following:
supervisedTuningSpec
object (
SupervisedTuningSpec
)
Tuning Spec for Supervised Fine Tuning.
PreTunedModel
| JSON representation |
|---|
{ "tunedModelName" : string , "checkpointId" : string , "baseModel" : string } |
| Fields | |
|---|---|
tunedModelName
|
The resource name of the Model. E.g., a model resource name with a specified version id or alias: Or, omit the version id to use the default version: |
checkpointId
|
Optional. The source checkpoint id. If not specified, the default checkpoint will be used. |
baseModel
|
Output only. The name of the base model this |
SupervisedTuningSpec
| JSON representation |
|---|
{
"trainingDatasetUri"
:
string
,
"validationDatasetUri"
:
string
,
"hyperParameters"
:
{
object (
|
| Fields | |
|---|---|
trainingDatasetUri
|
Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. |
validationDatasetUri
|
Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. |
hyperParameters
|
Optional. Hyperparameters for SFT. |
exportLastCheckpointOnly
|
Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false. |
SupervisedHyperParameters
| JSON representation |
|---|
{
"epochCount"
:
string
,
"learningRateMultiplier"
:
number
,
"adapterSize"
:
enum (
|
| Fields | |
|---|---|
epochCount
|
Optional. Number of complete passes the model makes over the entire training dataset during training. |
learningRateMultiplier
|
Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with |
adapterSize
|
Optional. Adapter size for tuning. |
Timestamp
| JSON representation |
|---|
{ "seconds" : string , "nanos" : integer } |
| Fields | |
|---|---|
seconds
|
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
nanos
|
Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |
Status
| JSON representation |
|---|
{ "code" : integer , "message" : string , "details" : [ { "@type" : string , field1 : ... , ... } ] } |
| Fields | |
|---|---|
code
|
The status code, which should be an enum value of |
message
|
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the |
details[]
|
A list of messages that carry the error details. There is a common set of message types for APIs to use. An object containing fields of an arbitrary type. An additional field |
Any
| JSON representation |
|---|
{ "typeUrl" : string , "value" : string } |
| Fields | |
|---|---|
typeUrl
|
Identifies the type of the serialized Protobuf message with a URI reference consisting of a prefix ending in a slash and the fully-qualified type name. Example: type.googleapis.com/google.protobuf.StringValue This string must contain at least one The prefix is arbitrary and Protobuf implementations are expected to simply strip off everything up to and including the last All type URL strings must be legal URI references with the additional restriction (for the text format) that the content of the reference must consist only of alphanumeric characters, percent-encoded escapes, and characters in the following set (not including the outer backticks): In the original design of |
value
|
Holds a Protobuf serialization of the type described by type_url. A base64-encoded string. |
LabelsEntry
| JSON representation |
|---|
{ "key" : string , "value" : string } |
| Fields | |
|---|---|
key
|
|
value
|
|
TunedModel
| JSON representation |
|---|
{
"model"
:
string
,
"endpoint"
:
string
,
"checkpoints"
:
[
{
object (
|
| Fields | |
|---|---|
model
|
Output only. The resource name of the TunedModel. Format: When tuning from a base model, the version ID will be 1. For continuous tuning, if the provided tuned_model_display_name is set and different from parent model's display name, the tuned model will have a new parent model with version 1. Otherwise the version id will be incremented by 1 from the last version ID in the parent model. E.g., |
endpoint
|
Output only. A resource name of an Endpoint. Format: |
checkpoints[]
|
Output only. The checkpoints associated with this TunedModel. This field is only populated for tuning jobs that enable intermediate checkpoints. |
TunedModelCheckpoint
| JSON representation |
|---|
{ "checkpointId" : string , "epoch" : string , "step" : string , "endpoint" : string } |
| Fields | |
|---|---|
checkpointId
|
The ID of the checkpoint. |
epoch
|
The epoch of the checkpoint. |
step
|
The step of the checkpoint. |
endpoint
|
The Endpoint resource name that the checkpoint is deployed to. Format: |
TuningDataStats
| JSON representation |
|---|
{ // Union field |
Union field tuning_data_stats
.
tuning_data_stats
can be only one of the following:
supervisedTuningDataStats
object (
SupervisedTuningDataStats
)
The SFT Tuning data stats.
SupervisedTuningDataStats
| JSON representation |
|---|
{ "tuningDatasetExampleCount" : string , "totalTuningCharacterCount" : string , "totalBillableCharacterCount" : string , "totalBillableTokenCount" : string , "tuningStepCount" : string , "userInputTokenDistribution" : { object ( |
| Fields | |
|---|---|
tuningDatasetExampleCount
|
Output only. Number of examples in the tuning dataset. |
totalTuningCharacterCount
|
Output only. Number of tuning characters in the tuning dataset. |
totalBillableCharacterCount
|
Output only. Number of billable characters in the tuning dataset. |
totalBillableTokenCount
|
Output only. Number of billable tokens in the tuning dataset. |
tuningStepCount
|
Output only. Number of tuning steps for this Tuning Job. |
userInputTokenDistribution
|
Output only. Dataset distributions for the user input tokens. |
userOutputTokenDistribution
|
Output only. Dataset distributions for the user output tokens. |
userMessagePerExampleDistribution
|
Output only. Dataset distributions for the messages per example. |
userDatasetExamples[]
|
Output only. Sample user messages in the training dataset uri. |
totalTruncatedExampleCount
|
Output only. The number of examples in the dataset that have been dropped. An example can be dropped for reasons including: too many tokens, contains an invalid image, contains too many images, etc. |
truncatedExampleIndices[]
|
Output only. A partial sample of the indices (starting from 1) of the dropped examples. |
droppedExampleReasons[]
|
Output only. For each index in |
SupervisedTuningDatasetDistribution
| JSON representation |
|---|
{
"sum"
:
string
,
"billableSum"
:
string
,
"min"
:
number
,
"max"
:
number
,
"mean"
:
number
,
"median"
:
number
,
"p5"
:
number
,
"p95"
:
number
,
"buckets"
:
[
{
object (
|
| Fields | |
|---|---|
sum
|
Output only. Sum of a given population of values. |
billableSum
|
Output only. Sum of a given population of values that are billable. |
min
|
Output only. The minimum of the population values. |
max
|
Output only. The maximum of the population values. |
mean
|
Output only. The arithmetic mean of the values in the population. |
median
|
Output only. The median of the values in the population. |
p5
|
Output only. The 5th percentile of the values in the population. |
p95
|
Output only. The 95th percentile of the values in the population. |
buckets[]
|
Output only. Defines the histogram bucket. |
DatasetBucket
| JSON representation |
|---|
{ "count" : number , "left" : number , "right" : number } |
| Fields | |
|---|---|
count
|
Output only. Number of values in the bucket. |
left
|
Output only. Left bound of the bucket. |
right
|
Output only. Right bound of the bucket. |
Content
| JSON representation |
|---|
{
"role"
:
string
,
"parts"
:
[
{
object (
|
| Fields | |
|---|---|
role
|
Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'. |
parts[]
|
Required. A list of A |
Part
| JSON representation |
|---|
{ "thought" : boolean , "thoughtSignature" : string , "mediaResolution" : { object ( |
thought
boolean
Optional. Indicates whether the part
represents the model's thought process or reasoning.
thoughtSignature
string ( bytes
format)
Optional. An opaque signature for the thought so it can be reused in subsequent requests.
A base64-encoded string.
mediaResolution
object (
MediaResolution
)
per part media resolution. Media resolution for the input media.
Union field data
.
data
can be only one of the following:
text
string
Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example @my-repo
will be converted to and sent as **my-repo**
by the IDE agent.
inlineData
object (
Blob
)
Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
fileData
object (
FileData
)
Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
functionCall
object (
FunctionCall
)
Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
functionResponse
object (
FunctionResponse
)
Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
executableCode
object (
ExecutableCode
)
Optional. Code generated by the model that is intended to be executed.
codeExecutionResult
object (
CodeExecutionResult
)
Optional. The result of executing the ExecutableCode
.
Union field metadata
.
metadata
can be only one of the following:
videoMetadata
object (
VideoMetadata
)
Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
Blob
| JSON representation |
|---|
{ "mimeType" : string , "data" : string , "displayName" : string } |
| Fields | |
|---|---|
mimeType
|
Required. The IANA standard MIME type of the source data. |
data
|
Required. The raw bytes of the data. A base64-encoded string. |
displayName
|
Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in |
FileData
| JSON representation |
|---|
{ "mimeType" : string , "fileUri" : string , "displayName" : string } |
| Fields | |
|---|---|
mimeType
|
Required. The IANA standard MIME type of the source data. |
fileUri
|
Required. The URI of the file in Google Cloud Storage. |
displayName
|
Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in |
FunctionCall
| JSON representation |
|---|
{
"name"
:
string
,
"args"
:
{
object
}
,
"partialArgs"
:
[
{
object (
|
| Fields | |
|---|---|
name
|
Optional. The name of the function to call. Matches |
args
|
Optional. The function parameters and values in JSON object format. See |
partialArgs[]
|
Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. |
willContinue
|
Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. |
Struct
| JSON representation |
|---|
{ "fields" : { string : value , ... } } |
| Fields | |
|---|---|
fields
|
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key" : string , "value" : value } |
| Fields | |
|---|---|
key
|
|
value
|
|
Value
| JSON representation |
|---|
{ // 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.
ListValue
| JSON representation |
|---|
{ "values" : [ value ] } |
| Fields | |
|---|---|
values[]
|
Repeated field of dynamically typed values. |
PartialArg
| JSON representation |
|---|
{ "jsonPath" : string , "willContinue" : boolean , // Union field |
jsonPath
string
Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535 . e.g. "$.foo.bar[0].data".
willContinue
boolean
Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
delta
. The delta of field value being streamed. delta
can be only one of the following:nullValue
null
Optional. Represents a null value.
numberValue
number
Optional. Represents a double value.
stringValue
string
Optional. Represents a string value.
boolValue
boolean
Optional. Represents a boolean value.
FunctionResponse
| JSON representation |
|---|
{
"name"
:
string
,
"response"
:
{
object
}
,
"parts"
:
[
{
object (
|
| Fields | |
|---|---|
name
|
Required. The name of the function to call. Matches |
response
|
Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output. |
parts[]
|
Optional. Ordered |
FunctionResponsePart
| JSON representation |
|---|
{ // Union field |
data
. The data of the function response part. data
can be only one of the following:inlineData
object (
FunctionResponseBlob
)
Inline media bytes.
fileData
object (
FunctionResponseFileData
)
URI based data.
FunctionResponseBlob
| JSON representation |
|---|
{ "mimeType" : string , "data" : string , "displayName" : string } |
| Fields | |
|---|---|
mimeType
|
Required. The IANA standard MIME type of the source data. |
data
|
Required. Raw bytes. A base64-encoded string. |
displayName
|
Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. |
FunctionResponseFileData
| JSON representation |
|---|
{ "mimeType" : string , "fileUri" : string , "displayName" : string } |
| Fields | |
|---|---|
mimeType
|
Required. The IANA standard MIME type of the source data. |
fileUri
|
Required. URI. |
displayName
|
Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. |
ExecutableCode
| JSON representation |
|---|
{
"language"
:
enum (
|
| Fields | |
|---|---|
language
|
Required. Programming language of the |
code
|
Required. The code to be executed. |
CodeExecutionResult
| JSON representation |
|---|
{
"outcome"
:
enum (
|
| Fields | |
|---|---|
outcome
|
Required. Outcome of the code execution. |
output
|
Optional. Contains stdout when code execution is successful, stderr or other description otherwise. |
VideoMetadata
| JSON representation |
|---|
{ "startOffset" : string , "endOffset" : string , "fps" : number } |
| Fields | |
|---|---|
startOffset
|
Optional. The start offset of the video. A duration in seconds with up to nine fractional digits, ending with ' |
endOffset
|
Optional. The end offset of the video. A duration in seconds with up to nine fractional digits, ending with ' |
fps
|
Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0]. |
Duration
| JSON representation |
|---|
{ "seconds" : string , "nanos" : integer } |
| Fields | |
|---|---|
seconds
|
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
nanos
|
Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 |
MediaResolution
| JSON representation |
|---|
{ // Union field |
Union field value
.
value
can be only one of the following:
level
enum (
Level
)
The tokenization quality used for given media.
EncryptionSpec
| JSON representation |
|---|
{ "kmsKeyName" : string } |
| Fields | |
|---|---|
kmsKeyName
|
Required. Resource name of the Cloud KMS key used to protect the resource. The Cloud KMS key must be in the same region as the resource. It must have the format |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌

