Skip to content

Commit b5a1e36

Browse files
authored
Merge pull request #3 from metricinsights/charts-bugfix
bugfix charts
2 parents ab78e59 + 3bd00b0 commit b5a1e36

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

mcp_server.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from fastmcp import FastMCP, Context
1111
from microcore import ui
1212

13-
1413
setup_logging()
1514

1615
mcp = FastMCP(
@@ -82,7 +81,11 @@ async def ask(agent: str, question: str, ctx: Context) -> str:
8281
json_serialized_data = json.dumps(
8382
dict(
8483
data_type="chart",
85-
data=i.data["chart_spec"],
84+
data=(
85+
json.loads(i.data["chart_spec"])
86+
if isinstance(i.data["chart_spec"], str)
87+
else i.data["chart_spec"]
88+
),
8689
),
8790
indent=2,
8891
)

snowflake_mcp/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
@dataclass
55
class Config:
6-
account: str = field(default='')
7-
token: str = field(default='')
8-
database: str = field(default='')
9-
schema: str = field(default='')
10-
agent: str = field(default='')
6+
account: str = field(default="")
7+
token: str = field(default="")
8+
database: str = field(default="")
9+
schema: str = field(default="")
10+
agent: str = field(default="")
1111
defaults: "Config" = field(default=None)
1212

1313
def __post_init__(self):

test_agent.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@
1616
res = i.data["text"]
1717
print(ui.blue(res), end="", flush=True)
1818
elif i.event_type == "response.tool_result.status":
19-
print(ui.yellow(
20-
f"[Status: {i.data['status']}]: {i.data.get('message', '')}"
21-
))
19+
print(ui.yellow(f"[Status: {i.data['status']}]: {i.data.get('message', '')}"))
2220
elif i.event_type == "response.status":
23-
print(ui.yellow(
24-
f"[Status: {i.data['status']}]: {i.data.get('message', '')}"
25-
))
21+
print(ui.yellow(f"[Status: {i.data['status']}]: {i.data.get('message', '')}"))
2622
elif i.event_type == "response.thinking.delta":
2723
res = i.data["text"]
2824
print(ui.gray(res), end="", flush=True)

0 commit comments

Comments
 (0)