get_file
Retrieve a specific file's content from a Git repository by supplying its URL and file path. Returns the content as a string or an error if the file cannot be found.
Instructions
Fetch the content of a single specified file from a Git repository.
This tool clones a Git repository from the provided URL, reads the content
of the specified file, and returns it as a string. The repository is cloned
with depth=1 for efficiency. If the file does not exist or an error occurs,
an appropriate error message is returned.
Args:
repo_url (str): The URL of the Git repository to clone.
file_path (str): The relative path to the file within the repository.
use_token (bool, optional): Whether to use the GitLab token for authentication.
Defaults to True.
Returns:
str: The content of the specified file, or an error message if retrieval fails.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repo_url": "<repo_url>",
"file_path": "<file_path>"
},
"name": "get_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_url | Yes | ||
| file_path | Yes | ||
| use_token | No |