|
10 | 10 | Tool, |
11 | 11 | ListRootsResult, |
12 | 12 | RootsCapability, |
| 13 | + ToolAnnotations, |
13 | 14 | ) |
14 | 15 | from enum import Enum |
15 | 16 | import git |
@@ -309,63 +310,133 @@ async def list_tools() -> list[Tool]: |
309 | 310 | name=GitTools.STATUS, |
310 | 311 | description="Shows the working tree status", |
311 | 312 | inputSchema=GitStatus.model_json_schema(), |
| 313 | + annotations=ToolAnnotations( |
| 314 | + readOnlyHint=True, |
| 315 | + destructiveHint=False, |
| 316 | + idempotentHint=True, |
| 317 | + openWorldHint=False, |
| 318 | + ), |
312 | 319 | ), |
313 | 320 | Tool( |
314 | 321 | name=GitTools.DIFF_UNSTAGED, |
315 | 322 | description="Shows changes in the working directory that are not yet staged", |
316 | 323 | inputSchema=GitDiffUnstaged.model_json_schema(), |
| 324 | + annotations=ToolAnnotations( |
| 325 | + readOnlyHint=True, |
| 326 | + destructiveHint=False, |
| 327 | + idempotentHint=True, |
| 328 | + openWorldHint=False, |
| 329 | + ), |
317 | 330 | ), |
318 | 331 | Tool( |
319 | 332 | name=GitTools.DIFF_STAGED, |
320 | 333 | description="Shows changes that are staged for commit", |
321 | 334 | inputSchema=GitDiffStaged.model_json_schema(), |
| 335 | + annotations=ToolAnnotations( |
| 336 | + readOnlyHint=True, |
| 337 | + destructiveHint=False, |
| 338 | + idempotentHint=True, |
| 339 | + openWorldHint=False, |
| 340 | + ), |
322 | 341 | ), |
323 | 342 | Tool( |
324 | 343 | name=GitTools.DIFF, |
325 | 344 | description="Shows differences between branches or commits", |
326 | 345 | inputSchema=GitDiff.model_json_schema(), |
| 346 | + annotations=ToolAnnotations( |
| 347 | + readOnlyHint=True, |
| 348 | + destructiveHint=False, |
| 349 | + idempotentHint=True, |
| 350 | + openWorldHint=False, |
| 351 | + ), |
327 | 352 | ), |
328 | 353 | Tool( |
329 | 354 | name=GitTools.COMMIT, |
330 | 355 | description="Records changes to the repository", |
331 | 356 | inputSchema=GitCommit.model_json_schema(), |
| 357 | + annotations=ToolAnnotations( |
| 358 | + readOnlyHint=False, |
| 359 | + destructiveHint=False, |
| 360 | + idempotentHint=False, |
| 361 | + openWorldHint=False, |
| 362 | + ), |
332 | 363 | ), |
333 | 364 | Tool( |
334 | 365 | name=GitTools.ADD, |
335 | 366 | description="Adds file contents to the staging area", |
336 | 367 | inputSchema=GitAdd.model_json_schema(), |
| 368 | + annotations=ToolAnnotations( |
| 369 | + readOnlyHint=False, |
| 370 | + destructiveHint=False, |
| 371 | + idempotentHint=True, |
| 372 | + openWorldHint=False, |
| 373 | + ), |
337 | 374 | ), |
338 | 375 | Tool( |
339 | 376 | name=GitTools.RESET, |
340 | 377 | description="Unstages all staged changes", |
341 | 378 | inputSchema=GitReset.model_json_schema(), |
| 379 | + annotations=ToolAnnotations( |
| 380 | + readOnlyHint=False, |
| 381 | + destructiveHint=True, |
| 382 | + idempotentHint=True, |
| 383 | + openWorldHint=False, |
| 384 | + ), |
342 | 385 | ), |
343 | 386 | Tool( |
344 | 387 | name=GitTools.LOG, |
345 | 388 | description="Shows the commit logs", |
346 | 389 | inputSchema=GitLog.model_json_schema(), |
| 390 | + annotations=ToolAnnotations( |
| 391 | + readOnlyHint=True, |
| 392 | + destructiveHint=False, |
| 393 | + idempotentHint=True, |
| 394 | + openWorldHint=False, |
| 395 | + ), |
347 | 396 | ), |
348 | 397 | Tool( |
349 | 398 | name=GitTools.CREATE_BRANCH, |
350 | 399 | description="Creates a new branch from an optional base branch", |
351 | 400 | inputSchema=GitCreateBranch.model_json_schema(), |
| 401 | + annotations=ToolAnnotations( |
| 402 | + readOnlyHint=False, |
| 403 | + destructiveHint=False, |
| 404 | + idempotentHint=False, |
| 405 | + openWorldHint=False, |
| 406 | + ), |
352 | 407 | ), |
353 | 408 | Tool( |
354 | 409 | name=GitTools.CHECKOUT, |
355 | 410 | description="Switches branches", |
356 | 411 | inputSchema=GitCheckout.model_json_schema(), |
| 412 | + annotations=ToolAnnotations( |
| 413 | + readOnlyHint=False, |
| 414 | + destructiveHint=False, |
| 415 | + idempotentHint=False, |
| 416 | + openWorldHint=False, |
| 417 | + ), |
357 | 418 | ), |
358 | 419 | Tool( |
359 | 420 | name=GitTools.SHOW, |
360 | 421 | description="Shows the contents of a commit", |
361 | 422 | inputSchema=GitShow.model_json_schema(), |
| 423 | + annotations=ToolAnnotations( |
| 424 | + readOnlyHint=True, |
| 425 | + destructiveHint=False, |
| 426 | + idempotentHint=True, |
| 427 | + openWorldHint=False, |
| 428 | + ), |
362 | 429 | ), |
363 | | - |
364 | 430 | Tool( |
365 | 431 | name=GitTools.BRANCH, |
366 | 432 | description="List Git branches", |
367 | 433 | inputSchema=GitBranch.model_json_schema(), |
368 | | - |
| 434 | + annotations=ToolAnnotations( |
| 435 | + readOnlyHint=True, |
| 436 | + destructiveHint=False, |
| 437 | + idempotentHint=True, |
| 438 | + openWorldHint=False, |
| 439 | + ), |
369 | 440 | ) |
370 | 441 | ] |
371 | 442 |
|
|
0 commit comments