Skip to content

Commit ce6374c

Browse files
committed
Fix MCP server bugs
- Fix get_models tool: Relationship has 'name' not 'to_model' attribute - Fix create_chart tool: Remove invalid 'labelFont' config parameter from Altair Fixes AttributeError when calling get_models tool and TypeError when creating charts.
1 parent 941897a commit ce6374c

3 files changed

Lines changed: 1583 additions & 1585 deletions

File tree

sidemantic/charts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ def _apply_theme(chart: Chart, title: str | None, width: int, height: int, color
318318
# Font configuration
319319
"font": "Inter, system-ui, -apple-system, sans-serif",
320320
"titleFont": "Inter, system-ui, -apple-system, sans-serif",
321-
"labelFont": "Inter, system-ui, -apple-system, sans-serif",
322321
# Title styling
323322
"title": {
324323
"fontSize": 18,

sidemantic/mcp_server.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,15 @@ def get_models(model_names: list[str]) -> list[dict[str, Any]]:
200200
# Get relationship details
201201
rels = []
202202
for rel in model.relationships:
203-
rels.append(
204-
{
205-
"name": rel.name,
206-
"to_model": rel.to_model,
207-
"type": rel.type,
208-
"sql_on": rel.sql_on,
209-
}
210-
)
203+
rel_info = {
204+
"name": rel.name,
205+
"type": rel.type,
206+
}
207+
if rel.foreign_key:
208+
rel_info["foreign_key"] = rel.foreign_key
209+
if rel.primary_key:
210+
rel_info["primary_key"] = rel.primary_key
211+
rels.append(rel_info)
211212

212213
detail = {
213214
"name": model_name,

0 commit comments

Comments
 (0)