Skip to content

Commit 9385063

Browse files
Add Fields to MCP tool params
1 parent eb5a0ff commit 9385063

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/seclab_taskflows/mcp_servers/codeql_python/mcp_server.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ def _run_query(query_name: str, database_path: str, language: str, template_valu
153153
backend = CodeqlSqliteBackend(MEMORY)
154154

155155
@mcp.tool()
156-
def remote_sources(owner: str, repo: str,
156+
def remote_sources(owner: str = Field(description="The owner of the GitHub repository", default=""),
157+
repo: str = Field(description="The name of the GitHub repository", default=""),
157158
database_path: str = Field(description="The CodeQL database path."),
158159
language: str = Field(description="The language used for the CodeQL database.")):
159160
"""List all remote sources and their locations in a CodeQL database, then store the results in a database."""
@@ -183,16 +184,16 @@ def remote_sources(owner: str, repo: str,
183184
return f"Stored {stored_count} remote sources in {repo}."
184185

185186
@mcp.tool()
186-
def fetch_sources(owner: str, repo: str):
187+
def fetch_sources(owner: str = Field(description="The owner of the GitHub repository", default=""), repo: str = Field(description="The name of the GitHub repository", default="")):
187188
"""
188189
Fetch all sources from the repo
189190
"""
190191
repo = process_repo(owner, repo)
191192
return json.dumps(backend.get_sources(repo))
192193

193194
@mcp.tool()
194-
def add_source_notes(owner: str, repo: str,
195-
# database_path: str = Field(description="The CodeQL database path."),
195+
def add_source_notes(owner: str = Field(description="The owner of the GitHub repository", default=""),
196+
repo: str = Field(description="The name of the GitHub repository", default=""),
196197
source_location: str = Field(description="The path to the file"),
197198
line: int = Field(description="The line number of the source"),
198199
notes: str = Field(description="The notes to append to this source", default="")):
@@ -203,7 +204,7 @@ def add_source_notes(owner: str, repo: str,
203204
return backend.store_new_source(repo = repo, source_location = source_location, line = line, source_type = "", notes = notes, update=True)
204205

205206
@mcp.tool()
206-
def clear_codeql_repo(owner: str, repo: str):
207+
def clear_codeql_repo(owner: str = Field(description="The owner of the GitHub repository", default=""), repo: str = Field(description="The name of the GitHub repository", default="")):
207208
"""
208209
Clear all data for a given repo from the database
209210
"""

0 commit comments

Comments
 (0)