|
17 | 17 | str_to_bool, |
18 | 18 | ) |
19 | 19 | from exasol.ai.mcp.server.mcp_resources import ( |
| 20 | + builtin_function_categories, |
20 | 21 | describe_builtin_function, |
21 | 22 | list_builtin_functions, |
22 | 23 | ) |
23 | 24 | from exasol.ai.mcp.server.mcp_server import ExasolMCPServer |
| 25 | +from exasol.ai.mcp.server.meta_query import SysInfoType |
24 | 26 | from exasol.ai.mcp.server.server_settings import ( |
25 | 27 | ExaDbResult, |
26 | 28 | McpServerSettings, |
@@ -350,49 +352,80 @@ def list_sql_types() -> ExaDbResult: |
350 | 352 | return mcp_server.list_sql_types() |
351 | 353 |
|
352 | 354 | @mcp_server.resource( |
353 | | - uri="system://system-tables", |
| 355 | + uri="system://system-table/list", |
354 | 356 | description="List of Exasol system tables.", |
355 | 357 | annotations={"readOnlyHint": True, "idempotentHint": True}, |
356 | 358 | ) |
357 | | - def list_system_tables() -> ExaDbResult: |
358 | | - return mcp_server.list_system_tables() |
| 359 | + def list_system_tables() -> list[str]: |
| 360 | + return mcp_server.list_system_tables(SysInfoType.SYSTEM) |
359 | 361 |
|
360 | 362 | @mcp_server.resource( |
361 | | - uri="system://statistics-tables", |
| 363 | + uri="system://system-table/details/{name}", |
| 364 | + description="Information about an Exasol system table with the specified name.", |
| 365 | + annotations={"readOnlyHint": True, "idempotentHint": True}, |
| 366 | + ) |
| 367 | + def describe_system_table(name: str) -> ExaDbResult: |
| 368 | + return mcp_server.describe_system_table(SysInfoType.SYSTEM, name) |
| 369 | + |
| 370 | + @mcp_server.resource( |
| 371 | + uri="system://statistics-table/list", |
362 | 372 | description="List of Exasol statistics tables.", |
363 | 373 | annotations={"readOnlyHint": True, "idempotentHint": True}, |
364 | 374 | ) |
365 | | - def list_statistics_tables() -> ExaDbResult: |
366 | | - return mcp_server.list_statistics_tables() |
| 375 | + def list_statistics_tables() -> list[str]: |
| 376 | + return mcp_server.list_system_tables(SysInfoType.STATISTICS) |
367 | 377 |
|
368 | 378 | @mcp_server.resource( |
369 | | - uri="dialect://reserved-keywords", |
370 | | - description="List of Exasol reserved keywords.", |
| 379 | + uri="system://statistics-table/details/{name}", |
| 380 | + description="Information about an Exasol statistics table with the specified name.", |
371 | 381 | annotations={"readOnlyHint": True, "idempotentHint": True}, |
372 | 382 | ) |
373 | | - def list_reserved_keywords() -> ExaDbResult: |
374 | | - return mcp_server.list_reserved_keywords() |
| 383 | + def describe_statistics_table(name) -> ExaDbResult: |
| 384 | + return mcp_server.describe_system_table(SysInfoType.STATISTICS, name) |
375 | 385 |
|
376 | 386 | @mcp_server.resource( |
377 | | - uri="dialect://built-in-functions/list/{category}", |
| 387 | + uri="dialect://keyword/reserved/{letter}", |
378 | 388 | description=( |
379 | | - "List of Exasol built-in functions by category. Categories: numeric, " |
380 | | - "string, date-time, geospatial, bitwise, conversion, other-scalar, " |
381 | | - "aggregate, analytic. A function can belong to more than one category." |
| 389 | + "List of Exasol keywords that are reserved words, " |
| 390 | + "and start from a given letter." |
382 | 391 | ), |
383 | 392 | annotations={"readOnlyHint": True, "idempotentHint": True}, |
384 | 393 | ) |
385 | | - def _list_builtin_functions(category: str) -> ExaDbResult: |
386 | | - return list_builtin_functions(category) |
| 394 | + def list_reserved_keywords(letter) -> list[str]: |
| 395 | + return mcp_server.list_keywords(True, letter) |
387 | 396 |
|
388 | 397 | @mcp_server.resource( |
389 | | - uri="dialect://built-in-functions/details/{name}", |
| 398 | + uri="dialect://keyword/non-reserved/{letter}", |
390 | 399 | description=( |
391 | | - "Information about a built-in function with the specified name. " |
392 | | - "May include usage notes and one or more examples." |
| 400 | + "List of Exasol keywords that are not reserved words, " |
| 401 | + "and start from a given letter." |
393 | 402 | ), |
394 | 403 | annotations={"readOnlyHint": True, "idempotentHint": True}, |
395 | 404 | ) |
| 405 | + def list_non_reserved_keywords(letter: str) -> list[str]: |
| 406 | + return mcp_server.list_keywords(False, letter) |
| 407 | + |
| 408 | + @mcp_server.resource( |
| 409 | + uri="dialect://built-in-function/categories", |
| 410 | + description="Exasol built-in function categories.", |
| 411 | + annotations={"readOnlyHint": True, "idempotentHint": True}, |
| 412 | + ) |
| 413 | + def _builtin_function_categories() -> list[str]: |
| 414 | + return builtin_function_categories() |
| 415 | + |
| 416 | + @mcp_server.resource( |
| 417 | + uri="dialect://built-in-function/list/{category}", |
| 418 | + description="List of Exasol built-in functions in the specified category.", |
| 419 | + annotations={"readOnlyHint": True, "idempotentHint": True}, |
| 420 | + ) |
| 421 | + def _list_builtin_functions(category: str) -> list[str]: |
| 422 | + return list_builtin_functions(category) |
| 423 | + |
| 424 | + @mcp_server.resource( |
| 425 | + uri="dialect://built-in-function/details/{name}", |
| 426 | + description="Information about a built-in function with the specified name.", |
| 427 | + annotations={"readOnlyHint": True, "idempotentHint": True}, |
| 428 | + ) |
396 | 429 | def _describe_builtin_function(name: str) -> ExaDbResult: |
397 | 430 | return describe_builtin_function(name) |
398 | 431 |
|
|
0 commit comments