Skip to content

Commit 21280e5

Browse files
author
shiraayal-tadata
committed
also in the mcp tools creation
1 parent 25c6d20 commit 21280e5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fastapi_mcp/openapi/convert.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ def convert_openapi_to_mcp_tools(
124124
# If we have an example response, add it to the docs
125125
if example_response:
126126
response_info += "\n\n**Example Response:**\n```json\n"
127-
response_info += json.dumps(example_response, indent=2)
127+
response_info += json.dumps(example_response, indent=2, ensure_ascii=False)
128128
response_info += "\n```"
129129
# Otherwise generate an example from the schema
130130
else:
131131
generated_example = generate_example_from_schema(display_schema)
132132
if generated_example:
133133
response_info += "\n\n**Example Response:**\n```json\n"
134-
response_info += json.dumps(generated_example, indent=2)
134+
response_info += json.dumps(generated_example, indent=2, ensure_ascii=False)
135135
response_info += "\n```"
136136

137137
# Only include full schema information if requested
@@ -141,15 +141,15 @@ def convert_openapi_to_mcp_tools(
141141
items_schema = display_schema["items"]
142142

143143
response_info += "\n\n**Output Schema:** Array of items with the following structure:\n```json\n"
144-
response_info += json.dumps(items_schema, indent=2)
144+
response_info += json.dumps(items_schema, indent=2, ensure_ascii=False)
145145
response_info += "\n```"
146146
elif "properties" in display_schema:
147147
response_info += "\n\n**Output Schema:**\n```json\n"
148-
response_info += json.dumps(display_schema, indent=2)
148+
response_info += json.dumps(display_schema, indent=2, ensure_ascii=False)
149149
response_info += "\n```"
150150
else:
151151
response_info += "\n\n**Output Schema:**\n```json\n"
152-
response_info += json.dumps(display_schema, indent=2)
152+
response_info += json.dumps(display_schema, indent=2, ensure_ascii=False)
153153
response_info += "\n```"
154154

155155
tool_description += response_info

0 commit comments

Comments
 (0)