You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Enhance file content retrieval with advanced chunking and optional plain text mode
- Add new methods `getCompletePullRequestFileContent` and `getCompleteFileFromBranch` for seamless file retrieval
- Implement parallel chunk retrieval with 5-minute timeout for large files
- Add optional `returnPlainText` parameter to control file content retrieval mode
- Improve error handling and logging for file content tools
- Update README with detailed usage examples and parameter descriptions
- Bump version to 1.0.5
|`azure_devops_pull_request_file_content`| Get content of large files in chunks |`repositoryId` (string), `pullRequestId` (number), `filePath` (string), `objectId` (string), `startPosition` (number), `length` (number), `project` (string) |
220
-
|`azure_devops_branch_file_content`| Get file content directly from a branch |`repositoryId` (string), `branchName` (string), `filePath` (string), `startPosition` (number), `length` (number), `project` (string) |
219
+
|`azure_devops_pull_request_file_content`| Get content of a specific file in a pull request |`repositoryId` (string), `pullRequestId` (number), `filePath` (string), `objectId` (string), `project` (string), optional: `returnPlainText` (boolean), `startPosition` (number), `length` (number) |
220
+
|`azure_devops_branch_file_content`| Get file content directly from a branch |`repositoryId` (string), `branchName` (string), `filePath` (string), `project` (string), optional: `returnPlainText` (boolean), `startPosition` (number), `length` (number) |
221
221
|`azure_devops_create_pr_comment`| Create a comment on a pull request |`repositoryId` (string), `pullRequestId` (number), `project` (string), `content` (string), and other optional parameters |
222
222
223
223
### File Content Tools
224
224
225
225
The file content tools (`azure_devops_pull_request_file_content` and `azure_devops_branch_file_content`) provide robust ways to access file content from repositories and pull requests:
226
226
227
+
-**Complete file retrieval**: By default, returns the complete file as plain text (set `returnPlainText=true` or omit this parameter)
228
+
-**Chunked access**: When `returnPlainText=false`, allows accessing large files in chunks by specifying start position and length
229
+
-**Parallel chunk retrieval**: Large files are retrieved using multiple parallel requests for better performance
230
+
-**5-minute timeout**: Extended timeout to ensure even large files can be retrieved completely
227
231
-**Automatic fallback**: If direct object ID access fails, the system will try accessing by branch name
228
232
-**Binary file detection**: Binary files are detected and handled appropriately
229
233
-**Circular reference handling**: Prevents JSON serialization errors due to circular references
230
-
-**Chunked access**: Large files can be accessed in chunks by specifying start position and length
231
234
-**Error reporting**: Detailed error messages are provided when file access fails
232
235
236
+
#### Example Usage:
237
+
238
+
**Get complete file as plain text (default):**
239
+
```json
240
+
{
241
+
"repositoryId": "your-repo-id",
242
+
"pullRequestId": 123,
243
+
"filePath": "src/path/to/file.ts",
244
+
"objectId": "file-object-id",
245
+
"project": "YourProject"
246
+
}
247
+
```
248
+
249
+
**Get file in chunks with metadata:**
250
+
```json
251
+
{
252
+
"repositoryId": "your-repo-id",
253
+
"branchName": "main",
254
+
"filePath": "src/path/to/file.ts",
255
+
"project": "YourProject",
256
+
"returnPlainText": false,
257
+
"startPosition": 0,
258
+
"length": 100000
259
+
}
260
+
```
261
+
233
262
When accessing large files or files in complex repositories, you may need to:
234
263
235
-
1. First try `azure_devops_pull_request_file_content` with the object ID from the PR changes
264
+
1. First try `azure_devops_pull_request_file_content` with the object ID from the PR changes and default `returnPlainText=true` to get the complete file
236
265
2. If that fails, use `azure_devops_branch_file_content` with the branch name from the PR details
237
-
3. For very large files, break down your requests into smaller chunks
266
+
3. For very large binary files, you may need to set `returnPlainText=false` and break down your requests into smaller chunks
0 commit comments