Commit a2212c0
committed
fix(repos): give create_or_update_file callers a SHA they can actually get
The create_or_update_file tool description and both of its SHA errors told
the caller to run `git rev-parse <branch>:<path>`. The caller is an MCP
client talking to the GitHub API, and the same description tells it not to
use this tool for local file operations, so it has no working tree to run
that command against.
Point the description at get_file_contents instead, which returns the blob
SHA over the API. In the already-exists error the server has just fetched
the file, so return that SHA directly rather than asking for a round trip.
The stale-SHA error already interpolates the current SHA, so it only needed
the impossible instruction removed.1 parent 64a49f3 commit a2212c0
3 files changed
Lines changed: 21 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
416 | | - | |
| 415 | + | |
417 | 416 | | |
418 | 417 | | |
419 | 418 | | |
| |||
549 | 548 | | |
550 | 549 | | |
551 | 550 | | |
552 | | - | |
553 | | - | |
| 551 | + | |
| 552 | + | |
554 | 553 | | |
555 | 554 | | |
556 | 555 | | |
| |||
594 | 593 | | |
595 | 594 | | |
596 | 595 | | |
597 | | - | |
598 | | - | |
| 596 | + | |
| 597 | + | |
599 | 598 | | |
600 | 599 | | |
601 | 600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2058 | 2058 | | |
2059 | 2059 | | |
2060 | 2060 | | |
| 2061 | + | |
| 2062 | + | |
2061 | 2063 | | |
2062 | 2064 | | |
2063 | 2065 | | |
| |||
2468 | 2470 | | |
2469 | 2471 | | |
2470 | 2472 | | |
2471 | | - | |
2472 | | - | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
2473 | 2478 | | |
2474 | 2479 | | |
2475 | 2480 | | |
| |||
2531 | 2536 | | |
2532 | 2537 | | |
2533 | 2538 | | |
2534 | | - | |
2535 | | - | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
2536 | 2544 | | |
2537 | 2545 | | |
2538 | 2546 | | |
| |||
2607 | 2615 | | |
2608 | 2616 | | |
2609 | 2617 | | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
2610 | 2621 | | |
2611 | 2622 | | |
2612 | 2623 | | |
| |||
0 commit comments