get_repo_file_content
Access file contents or directory listings from a repository using provided path, branch, and cache options.
Instructions
Retrieve file contents or directory listings from a repository.
Args:
repo_path (str): Path or URL to the repository
resource_path (str, optional): Path to the target file or directory within the repository. Defaults to the repository root if not provided.
branch (str, optional): Specific branch to read from (only used with per-branch cache strategy)
cache_strategy (str, optional): Cache strategy - "shared" (default) or "per-branch"
Returns:
dict: For files:
{
"type": "file",
"path": str, # Relative path within repository
"content": str, # Complete file contents
"branch": str, # Current branch name
"cache_strategy": str # Cache strategy used
}
For directories:
{
"type": "directory",
"path": str, # Relative path within repository
"contents": List[str], # List of immediate files and subdirectories
"branch": str, # Current branch name
"cache_strategy": str # Cache strategy used
}
Note:
Directory listings are not recursive - they only show immediate contents.
To explore subdirectories, make additional calls with the subdirectory path.
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_path": "<repo_path>"
},
"name": "get_repo_file_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | No | ||
| repo_path | Yes | ||
| resource_path | No | ||
| cache_strategy | No | shared |