Skip to content

Commit f905115

Browse files
Merge pull request #279 from rakesh-eltropy/main
Replaced hyphen with underscore in Sqlite & Sentry tools..
2 parents eed1282 + 63a7fe9 commit f905115

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/sentry/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A Model Context Protocol server for retrieving and analyzing issues from Sentry.
66

77
### Tools
88

9-
1. `get-sentry-issue`
9+
1. `get_sentry_issue`
1010
- Retrieve and analyze a Sentry issue by ID or URL
1111
- Input:
1212
- `issue_id_or_url` (string): Sentry issue ID or URL to analyze

src/sentry/src/mcp_server_sentry/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ async def handle_get_prompt(
223223
async def handle_list_tools() -> list[types.Tool]:
224224
return [
225225
types.Tool(
226-
name="get-sentry-issue",
226+
name="get_sentry_issue",
227227
description="""Retrieve and analyze a Sentry issue by ID or URL. Use this tool when you need to:
228228
- Investigate production errors and crashes
229229
- Access detailed stacktraces from Sentry
@@ -247,7 +247,7 @@ async def handle_list_tools() -> list[types.Tool]:
247247
async def handle_call_tool(
248248
name: str, arguments: dict | None
249249
) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
250-
if name != "get-sentry-issue":
250+
if name != "get_sentry_issue":
251251
raise ValueError(f"Unknown tool: {name}")
252252

253253
if not arguments or "issue_id_or_url" not in arguments:

src/sqlite/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@ The server provides a demonstration prompt:
2222
The server offers six core tools:
2323

2424
#### Query Tools
25-
- `read-query`
25+
- `read_query`
2626
- Execute SELECT queries to read data from the database
2727
- Input:
2828
- `query` (string): The SELECT SQL query to execute
2929
- Returns: Query results as array of objects
3030

31-
- `write-query`
31+
- `write_query`
3232
- Execute INSERT, UPDATE, or DELETE queries
3333
- Input:
3434
- `query` (string): The SQL modification query
3535
- Returns: `{ affected_rows: number }`
3636

37-
- `create-table`
37+
- `create_table`
3838
- Create new tables in the database
3939
- Input:
4040
- `query` (string): CREATE TABLE SQL statement
4141
- Returns: Confirmation of table creation
4242

4343
#### Schema Tools
44-
- `list-tables`
44+
- `list_tables`
4545
- Get a list of all tables in the database
4646
- No input required
4747
- Returns: Array of table names
@@ -53,7 +53,7 @@ The server offers six core tools:
5353
- Returns: Array of column definitions with names and types
5454

5555
#### Analysis Tools
56-
- `append-insight`
56+
- `append_insight`
5757
- Add new business insights to the memo resource
5858
- Input:
5959
- `insight` (string): Business insight discovered from data analysis

src/sqlite/src/mcp_server_sqlite/server.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
This server exposes one key resource: "memo://insights", which is a business insights memo that gets automatically updated throughout the analysis process. As users analyze the database and discover insights, the memo resource gets updated in real-time to reflect new findings. Resources act as living documents that provide context to the conversation.
2828
Tools:
2929
This server provides several SQL-related tools:
30-
"read-query": Executes SELECT queries to read data from the database
31-
"write-query": Executes INSERT, UPDATE, or DELETE queries to modify data
32-
"create-table": Creates new tables in the database
33-
"list-tables": Shows all existing tables
34-
"describe-table": Shows the schema for a specific table
35-
"append-insight": Adds a new business insight to the memo resource
30+
"read_query": Executes SELECT queries to read data from the database
31+
"write_query": Executes INSERT, UPDATE, or DELETE queries to modify data
32+
"create_table": Creates new tables in the database
33+
"list_tables": Shows all existing tables
34+
"describe_table": Shows the schema for a specific table
35+
"append_insight": Adds a new business insight to the memo resource
3636
</mcp>
3737
<demo-instructions>
3838
You are an AI assistant tasked with generating a comprehensive business scenario based on a given topic.
@@ -68,7 +68,7 @@
6868
b. Explain the purpose of each query option.
6969
c. Wait for the user to select one of the query options.
7070
d. After each query be sure to opine on the results.
71-
e. Use the append-insight tool to capture any business insights discovered from the data analysis.
71+
e. Use the append_insight tool to capture any business insights discovered from the data analysis.
7272
7373
7. Generate a dashboard:
7474
a. Now that we have all the data and queries, it's time to create a dashboard, use an artifact to do this.
@@ -233,7 +233,7 @@ async def handle_list_tools() -> list[types.Tool]:
233233
"""List available tools"""
234234
return [
235235
types.Tool(
236-
name="read-query",
236+
name="read_query",
237237
description="Execute a SELECT query on the SQLite database",
238238
inputSchema={
239239
"type": "object",
@@ -244,7 +244,7 @@ async def handle_list_tools() -> list[types.Tool]:
244244
},
245245
),
246246
types.Tool(
247-
name="write-query",
247+
name="write_query",
248248
description="Execute an INSERT, UPDATE, or DELETE query on the SQLite database",
249249
inputSchema={
250250
"type": "object",
@@ -255,7 +255,7 @@ async def handle_list_tools() -> list[types.Tool]:
255255
},
256256
),
257257
types.Tool(
258-
name="create-table",
258+
name="create_table",
259259
description="Create a new table in the SQLite database",
260260
inputSchema={
261261
"type": "object",
@@ -266,15 +266,15 @@ async def handle_list_tools() -> list[types.Tool]:
266266
},
267267
),
268268
types.Tool(
269-
name="list-tables",
269+
name="list_tables",
270270
description="List all tables in the SQLite database",
271271
inputSchema={
272272
"type": "object",
273273
"properties": {},
274274
},
275275
),
276276
types.Tool(
277-
name="describe-table",
277+
name="describe_table",
278278
description="Get the schema information for a specific table",
279279
inputSchema={
280280
"type": "object",
@@ -285,7 +285,7 @@ async def handle_list_tools() -> list[types.Tool]:
285285
},
286286
),
287287
types.Tool(
288-
name="append-insight",
288+
name="append_insight",
289289
description="Add a business insight to the memo",
290290
inputSchema={
291291
"type": "object",
@@ -303,21 +303,21 @@ async def handle_call_tool(
303303
) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
304304
"""Handle tool execution requests"""
305305
try:
306-
if name == "list-tables":
306+
if name == "list_tables":
307307
results = db._execute_query(
308308
"SELECT name FROM sqlite_master WHERE type='table'"
309309
)
310310
return [types.TextContent(type="text", text=str(results))]
311311

312-
elif name == "describe-table":
312+
elif name == "describe_table":
313313
if not arguments or "table_name" not in arguments:
314314
raise ValueError("Missing table_name argument")
315315
results = db._execute_query(
316316
f"PRAGMA table_info({arguments['table_name']})"
317317
)
318318
return [types.TextContent(type="text", text=str(results))]
319319

320-
elif name == "append-insight":
320+
elif name == "append_insight":
321321
if not arguments or "insight" not in arguments:
322322
raise ValueError("Missing insight argument")
323323

@@ -332,19 +332,19 @@ async def handle_call_tool(
332332
if not arguments:
333333
raise ValueError("Missing arguments")
334334

335-
if name == "read-query":
335+
if name == "read_query":
336336
if not arguments["query"].strip().upper().startswith("SELECT"):
337-
raise ValueError("Only SELECT queries are allowed for read-query")
337+
raise ValueError("Only SELECT queries are allowed for read_query")
338338
results = db._execute_query(arguments["query"])
339339
return [types.TextContent(type="text", text=str(results))]
340340

341-
elif name == "write-query":
341+
elif name == "write_query":
342342
if arguments["query"].strip().upper().startswith("SELECT"):
343-
raise ValueError("SELECT queries are not allowed for write-query")
343+
raise ValueError("SELECT queries are not allowed for write_query")
344344
results = db._execute_query(arguments["query"])
345345
return [types.TextContent(type="text", text=str(results))]
346346

347-
elif name == "create-table":
347+
elif name == "create_table":
348348
if not arguments["query"].strip().upper().startswith("CREATE TABLE"):
349349
raise ValueError("Only CREATE TABLE statements are allowed")
350350
db._execute_query(arguments["query"])

0 commit comments

Comments
 (0)