Tool: read_repository_file
Return the contents of a file that's inside a Dataform repository.
This tool isn't for standard pipeline development. It's intended for direct repository interaction, typically for managing single-file assets such as notebooks or saved queries.
The name parameter value refers to the repository and must be in the format projects/{project_id}/locations/{location}/repositories/{repository}.
The path parameter value is the relative path to the file from the repository root. Valid file paths can be obtained using the query_repository_directory_contents tool.
The following sample demonstrate how to use curl to invoke the read_repository_file MCP tool.
| Curl Request |
|---|
curl --location 'https://dataform.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "read_repository_file", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
ReadRepositoryFile request message.
ReadRepositoryFileRequest
| JSON representation |
|---|
{ "name": string, "commitSha": string, "path": string } |
| Fields | |
|---|---|
name |
Required. The repository's name. |
commitSha |
Optional. The commit SHA for the commit to read from. If unset, the file will be read from HEAD. |
path |
Required. Full file path to read including filename, from repository root. |
Output Schema
ReadRepositoryFile response message.
ReadRepositoryFileResponse
| JSON representation |
|---|
{ "contents": string } |
| Fields | |
|---|---|
contents |
The file's contents. A base64-encoded string. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌