Skip to content

Commit 04ca2fe

Browse files
committed
Tighten formatter types: required-field access + plotly stub ignore
1 parent e73cd17 commit 04ca2fe

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

dash/mcp/primitives/tools/results/result_dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DataFrameResult(ResultFormatter):
5050
def format(
5151
cls, output: MCPOutput, returned_output_value: Any
5252
) -> list[TextContent | ImageContent]:
53-
if not TABULAR.matches(output.get("component_type"), output.get("property")):
53+
if not TABULAR.matches(output.get("component_type"), output["property"]):
5454
return []
5555
if (
5656
not isinstance(returned_output_value, list)

dash/mcp/primitives/tools/results/result_plotly_figure.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import logging
77
from typing import Any
88

9-
import plotly.graph_objects as go
9+
import plotly.graph_objects as go # type: ignore[import-untyped]
1010
from mcp.types import ImageContent, TextContent
1111

1212
from dash.mcp.types import MCPOutput
@@ -46,9 +46,7 @@ class PlotlyFigureResult(ResultFormatter):
4646
def format(
4747
cls, output: MCPOutput, returned_output_value: Any
4848
) -> list[TextContent | ImageContent]:
49-
if not PLOTLY_FIGURE.matches(
50-
output.get("component_type"), output.get("property")
51-
):
49+
if not PLOTLY_FIGURE.matches(output.get("component_type"), output["property"]):
5250
return []
5351
if not isinstance(returned_output_value, dict):
5452
return []

0 commit comments

Comments
 (0)