Skip to content

Commit 2164a1a

Browse files
Merge main branch and resolve conflict in repo_context.py
Co-authored-by: kevinbackhouse <[email protected]>
1 parent 1d2bb33 commit 2164a1a

File tree

1 file changed

+107
-42
lines changed

1 file changed

+107
-42
lines changed

src/seclab_taskflows/mcp_servers/repo_context.py

Lines changed: 107 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ def clear_repo_issues(self, repo):
402402

403403
@mcp.tool()
404404
def store_new_component(
405-
owner: str,
406-
repo: str,
405+
owner: str = Field(description="The owner of the GitHub repository"),
406+
repo: str = Field(description="The name of the GitHub repository"),
407407
location: str = Field(description="The directory of the component"),
408408
is_app: bool = Field(description="Is this an application", default=None),
409409
is_library: bool = Field(description="Is this a library", default=None),
@@ -417,8 +417,8 @@ def store_new_component(
417417

418418
@mcp.tool()
419419
def add_component_notes(
420-
owner: str,
421-
repo: str,
420+
owner: str = Field(description="The owner of the GitHub repository"),
421+
repo: str = Field(description="The name of the GitHub repository"),
422422
location: str = Field(description="The directory of the component", default=None),
423423
notes: str = Field(description="New notes taken for this component", default=""),
424424
):
@@ -434,9 +434,9 @@ def add_component_notes(
434434

435435
@mcp.tool()
436436
def store_new_entry_point(
437-
owner: str,
438-
repo: str,
439-
location: str = Field(description="The directory of the component where the entry point belonged to"),
437+
owner: str = Field(description="The owner of the GitHub repository"),
438+
repo: str = Field(description="The name of the GitHub repository"),
439+
location: str = Field(description="The directory of the component where the entry point belongs to"),
440440
file: str = Field(description="The file that contains the entry point"),
441441
line: int = Field(description="The file line that contains the entry point"),
442442
user_input: str = Field(description="The variables that are considered as user input"),
@@ -453,7 +453,13 @@ def store_new_entry_point(
453453

454454

455455
@mcp.tool()
456-
def store_new_component_issue(owner: str, repo: str, component_id: int, issue_type: str, notes: str):
456+
def store_new_component_issue(
457+
owner: str = Field(description="The owner of the GitHub repository"),
458+
repo: str = Field(description="The name of the GitHub repository"),
459+
component_id: int = Field(description="The ID of the component"),
460+
issue_type: str = Field(description="The type of issue"),
461+
notes: str = Field(description="Notes about the issue"),
462+
):
457463
"""
458464
Stores a type of common issue for a component.
459465
"""
@@ -463,11 +469,11 @@ def store_new_component_issue(owner: str, repo: str, component_id: int, issue_ty
463469

464470
@mcp.tool()
465471
def store_new_audit_result(
466-
owner: str,
467-
repo: str,
468-
component_id: int,
469-
issue_type: str,
470-
issue_id: int,
472+
owner: str = Field(description="The owner of the GitHub repository"),
473+
repo: str = Field(description="The name of the GitHub repository"),
474+
component_id: int = Field(description="The ID of the component"),
475+
issue_type: str = Field(description="The type of issue"),
476+
issue_id: int = Field(description="The ID of the issue"),
471477
has_non_security_error: bool = Field(
472478
description="Set to true if there are security issues or logic error but may not be exploitable"
473479
),
@@ -485,8 +491,8 @@ def store_new_audit_result(
485491

486492
@mcp.tool()
487493
def store_new_web_entry_point(
488-
owner: str,
489-
repo: str,
494+
owner: str = Field(description="The owner of the GitHub repository"),
495+
repo: str = Field(description="The name of the GitHub repository"),
490496
entry_point_id: int = Field(description="The ID of the entry point this web entry point refers to"),
491497
location: str = Field(description="The directory of the component where the web entry point belongs to"),
492498
method: str = Field(description="HTTP method (GET, POST, etc)", default=""),
@@ -508,9 +514,9 @@ def store_new_web_entry_point(
508514

509515
@mcp.tool()
510516
def add_entry_point_notes(
511-
owner: str,
512-
repo: str,
513-
location: str = Field(description="The directory of the component where the entry point belonged to"),
517+
owner: str = Field(description="The owner of the GitHub repository"),
518+
repo: str = Field(description="The name of the GitHub repository"),
519+
location: str = Field(description="The directory of the component where the entry point belongs to"),
514520
file: str = Field(description="The file that contains the entry point"),
515521
line: int = Field(description="The file line that contains the entry point"),
516522
notes: str = Field(description="The notes for this entry point", default=""),
@@ -527,9 +533,9 @@ def add_entry_point_notes(
527533

528534
@mcp.tool()
529535
def store_new_user_action(
530-
owner: str,
531-
repo: str,
532-
location: str = Field(description="The directory of the component where the user action belonged to"),
536+
owner: str = Field(description="The owner of the GitHub repository"),
537+
repo: str = Field(description="The name of the GitHub repository"),
538+
location: str = Field(description="The directory of the component where the user action belongs to"),
533539
file: str = Field(description="The file that contains the user action"),
534540
line: int = Field(description="The file line that contains the user action"),
535541
notes: str = Field(description="New notes for this user action", default=""),
@@ -546,9 +552,9 @@ def store_new_user_action(
546552

547553
@mcp.tool()
548554
def add_user_action_notes(
549-
owner: str,
550-
repo: str,
551-
location: str = Field(description="The directory of the component where the user action belonged to"),
555+
owner: str = Field(description="The owner of the GitHub repository"),
556+
repo: str = Field(description="The name of the GitHub repository"),
557+
location: str = Field(description="The directory of the component where the user action belongs to"),
552558
file: str = Field(description="The file that contains the user action"),
553559
line: str = Field(description="The file line that contains the user action"),
554560
notes: str = Field(description="The notes for user action", default=""),
@@ -561,9 +567,13 @@ def add_user_action_notes(
561567

562568

563569
@mcp.tool()
564-
def get_component(owner: str, repo: str, location: str = Field(description="The directory of the component")):
570+
def get_component(
571+
owner: str = Field(description="The owner of the GitHub repository"),
572+
repo: str = Field(description="The name of the GitHub repository"),
573+
location: str = Field(description="The directory of the component"),
574+
):
565575
"""
566-
The a component from the database
576+
Get a component from the database
567577
"""
568578
repo = process_repo(owner, repo)
569579
app = backend.get_app(repo, location)
@@ -573,7 +583,10 @@ def get_component(owner: str, repo: str, location: str = Field(description="The
573583

574584

575585
@mcp.tool()
576-
def get_components(owner: str, repo: str):
586+
def get_components(
587+
owner: str = Field(description="The owner of the GitHub repository"),
588+
repo: str = Field(description="The name of the GitHub repository"),
589+
):
577590
"""
578591
Get components from the repo
579592
"""
@@ -582,7 +595,11 @@ def get_components(owner: str, repo: str):
582595

583596

584597
@mcp.tool()
585-
def get_entry_points(owner: str, repo: str, location: str = Field(description="The directory of the component")):
598+
def get_entry_points(
599+
owner: str = Field(description="The owner of the GitHub repository"),
600+
repo: str = Field(description="The name of the GitHub repository"),
601+
location: str = Field(description="The directory of the component"),
602+
):
586603
"""
587604
Get all the entry points of a component.
588605
"""
@@ -591,7 +608,10 @@ def get_entry_points(owner: str, repo: str, location: str = Field(description="T
591608

592609

593610
@mcp.tool()
594-
def get_entry_points_for_repo(owner: str, repo: str):
611+
def get_entry_points_for_repo(
612+
owner: str = Field(description="The owner of the GitHub repository"),
613+
repo: str = Field(description="The name of the GitHub repository"),
614+
):
595615
"""
596616
Get all entry points of an repo
597617
"""
@@ -600,7 +620,11 @@ def get_entry_points_for_repo(owner: str, repo: str):
600620

601621

602622
@mcp.tool()
603-
def get_web_entry_points_component(owner: str, repo: str, component_id: int):
623+
def get_web_entry_points_component(
624+
owner: str = Field(description="The owner of the GitHub repository"),
625+
repo: str = Field(description="The name of the GitHub repository"),
626+
component_id: int = Field(description="The ID of the component"),
627+
):
604628
"""
605629
Get all web entry points for a component
606630
"""
@@ -609,7 +633,10 @@ def get_web_entry_points_component(owner: str, repo: str, component_id: int):
609633

610634

611635
@mcp.tool()
612-
def get_web_entry_points_for_repo(owner: str, repo: str):
636+
def get_web_entry_points_for_repo(
637+
owner: str = Field(description="The owner of the GitHub repository"),
638+
repo: str = Field(description="The name of the GitHub repository"),
639+
):
613640
"""
614641
Get all web entry points of an repo
615642
"""
@@ -618,7 +645,11 @@ def get_web_entry_points_for_repo(owner: str, repo: str):
618645

619646

620647
@mcp.tool()
621-
def get_user_actions(owner: str, repo: str, location: str = Field(description="The directory of the component")):
648+
def get_user_actions(
649+
owner: str = Field(description="The owner of the GitHub repository"),
650+
repo: str = Field(description="The name of the GitHub repository"),
651+
location: str = Field(description="The directory of the component"),
652+
):
622653
"""
623654
Get all the user actions in a component.
624655
"""
@@ -627,7 +658,10 @@ def get_user_actions(owner: str, repo: str, location: str = Field(description="T
627658

628659

629660
@mcp.tool()
630-
def get_user_actions_for_repo(owner: str, repo: str):
661+
def get_user_actions_for_repo(
662+
owner: str = Field(description="The owner of the GitHub repository"),
663+
repo: str = Field(description="The name of the GitHub repository"),
664+
):
631665
"""
632666
Get all the user actions in a repo.
633667
"""
@@ -636,7 +670,11 @@ def get_user_actions_for_repo(owner: str, repo: str):
636670

637671

638672
@mcp.tool()
639-
def get_component_issues(owner: str, repo: str, component_id: int):
673+
def get_component_issues(
674+
owner: str = Field(description="The owner of the GitHub repository"),
675+
repo: str = Field(description="The name of the GitHub repository"),
676+
component_id: int = Field(description="The ID of the component"),
677+
):
640678
"""
641679
Get issues for the component.
642680
"""
@@ -645,7 +683,11 @@ def get_component_issues(owner: str, repo: str, component_id: int):
645683

646684

647685
@mcp.tool()
648-
def get_component_results(owner: str, repo: str, component_id: int):
686+
def get_component_results(
687+
owner: str = Field(description="The owner of the GitHub repository"),
688+
repo: str = Field(description="The name of the GitHub repository"),
689+
component_id: int = Field(description="The ID of the component"),
690+
):
649691
"""
650692
Get audit results for the component.
651693
"""
@@ -654,7 +696,11 @@ def get_component_results(owner: str, repo: str, component_id: int):
654696

655697

656698
@mcp.tool()
657-
def get_component_vulnerable_results(owner: str, repo: str, component_id: int):
699+
def get_component_vulnerable_results(
700+
owner: str = Field(description="The owner of the GitHub repository"),
701+
repo: str = Field(description="The name of the GitHub repository"),
702+
component_id: int = Field(description="The ID of the component"),
703+
):
658704
"""
659705
Get audit results for the component that are audited as vulnerable.
660706
"""
@@ -665,7 +711,11 @@ def get_component_vulnerable_results(owner: str, repo: str, component_id: int):
665711

666712

667713
@mcp.tool()
668-
def get_component_potential_results(owner: str, repo: str, component_id: int):
714+
def get_component_potential_results(
715+
owner: str = Field(description="The owner of the GitHub repository"),
716+
repo: str = Field(description="The name of the GitHub repository"),
717+
component_id: int = Field(description="The ID of the component"),
718+
):
669719
"""
670720
Get audit results for the component that are audited as an issue but may not be exploitable.
671721
"""
@@ -676,7 +726,10 @@ def get_component_potential_results(owner: str, repo: str, component_id: int):
676726

677727

678728
@mcp.tool()
679-
def get_audit_results_for_repo(owner: str, repo: str):
729+
def get_audit_results_for_repo(
730+
owner: str = Field(description="The owner of the GitHub repository"),
731+
repo: str = Field(description="The name of the GitHub repository"),
732+
):
680733
"""
681734
Get audit results for the repo.
682735
"""
@@ -687,7 +740,10 @@ def get_audit_results_for_repo(owner: str, repo: str):
687740

688741

689742
@mcp.tool()
690-
def get_vulnerable_audit_results_for_repo(owner: str, repo: str):
743+
def get_vulnerable_audit_results_for_repo(
744+
owner: str = Field(description="The owner of the GitHub repository"),
745+
repo: str = Field(description="The name of the GitHub repository"),
746+
):
691747
"""
692748
Get audit results for the repo that are audited as vulnerable.
693749
"""
@@ -698,7 +754,10 @@ def get_vulnerable_audit_results_for_repo(owner: str, repo: str):
698754

699755

700756
@mcp.tool()
701-
def get_potential_audit_results_for_repo(owner: str, repo: str):
757+
def get_potential_audit_results_for_repo(
758+
owner: str = Field(description="The owner of the GitHub repository"),
759+
repo: str = Field(description="The name of the GitHub repository"),
760+
):
702761
"""
703762
Get audit results for the repo that are potential issues but may not be exploitable.
704763
"""
@@ -709,7 +768,10 @@ def get_potential_audit_results_for_repo(owner: str, repo: str):
709768

710769

711770
@mcp.tool()
712-
def clear_repo(owner: str, repo: str):
771+
def clear_repo(
772+
owner: str = Field(description="The owner of the GitHub repository"),
773+
repo: str = Field(description="The name of the GitHub repository"),
774+
):
713775
"""
714776
clear all results for repo.
715777
"""
@@ -718,7 +780,10 @@ def clear_repo(owner: str, repo: str):
718780

719781

720782
@mcp.tool()
721-
def clear_component_issues_for_repo(owner: str, repo: str):
783+
def clear_component_issues_for_repo(
784+
owner: str = Field(description="The owner of the GitHub repository"),
785+
repo: str = Field(description="The name of the GitHub repository"),
786+
):
722787
"""
723788
clear all results for repo.
724789
"""

0 commit comments

Comments
 (0)