Skip to content

Commit 12992c4

Browse files
committed
chore: #220 - adds a tool to get all data types
1 parent 6fa756e commit 12992c4

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
TAG_SERVICES: 0.0.9
2323
TAG_EXTERNAL: 0.0.1
2424
TAG_UI: 0.0.31
25-
TAG_MCP: 0.0.5
25+
TAG_MCP: 0.0.6
2626

2727
steps:
2828
- name: Checkout code

objectified-mcp/server.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ async def hello() -> str:
3737
print("Hello World")
3838
return f"Hello world!"
3939

40+
@mcp.tool()
41+
async def get_data_types() -> list[str]:
42+
"""Retrieves a list of all available data types"""
43+
conn = connect_to_postgres(DATABASE_URL)
44+
results = run_query(conn, "SELECT * FROM obj.data_type WHERE enabled")
45+
print(f"[get_data_types]: results={len(results)}")
46+
return results if len(results) > 0 else []
47+
4048
@mcp.resource("classes://{name}/by_name")
4149
async def get_class_ids_by_name(name: str) -> list[str]:
4250
"""Retrieves a list of classes by ID based on the name specified"""

0 commit comments

Comments
 (0)