From e55b8f35a756fd8b4f42bbbe8143a0bae5ff9e34 Mon Sep 17 00:00:00 2001 From: abrar360 Date: Thu, 10 Jul 2025 23:46:10 -0400 Subject: [PATCH 1/2] Fix: default value argument in jinja template causing errors for string variables --- nerve/tools/mcp/body.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nerve/tools/mcp/body.j2 b/nerve/tools/mcp/body.j2 index d04e456..44dfe97 100644 --- a/nerve/tools/mcp/body.j2 +++ b/nerve/tools/mcp/body.j2 @@ -2,7 +2,7 @@ from typing import * from pydantic import Field from loguru import logger -async def {{ tool.name }}({% for arg in arguments %}{{ arg.name }}: Annotated[{{ arg.type }}, "{{ arg.description }}"]{% if 'default' in arg %} = {{ arg.default }}{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) -> Any: +async def {{ tool.name }}({% for arg in arguments %}{{ arg.name }}: Annotated[{{ arg.type }}, "{{ arg.description }}"]{% if 'default' in arg %} = {% if arg.type == "str" %}"{{ arg.default }}"{% else %}{{ arg.default > """{{ tool.description }}""" - return await globals().get("{{ client_name }}", None).call_tool("{{ tool.name }}", **locals()) \ No newline at end of file + return await globals().get("{{ client_name }}", None).call_tool("{{ tool.name }}", **locals()) From 33004c4d1213ec0a321fb7df7a75df0c5700c6c1 Mon Sep 17 00:00:00 2001 From: abrar360 Date: Fri, 11 Jul 2025 00:04:20 -0400 Subject: [PATCH 2/2] Fix: default value argument in jinja template causing errors for string variables (for real this time) --- nerve/tools/mcp/body.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerve/tools/mcp/body.j2 b/nerve/tools/mcp/body.j2 index 44dfe97..451445a 100644 --- a/nerve/tools/mcp/body.j2 +++ b/nerve/tools/mcp/body.j2 @@ -2,7 +2,7 @@ from typing import * from pydantic import Field from loguru import logger -async def {{ tool.name }}({% for arg in arguments %}{{ arg.name }}: Annotated[{{ arg.type }}, "{{ arg.description }}"]{% if 'default' in arg %} = {% if arg.type == "str" %}"{{ arg.default }}"{% else %}{{ arg.default > +async def {{ tool.name }}({% for arg in arguments %}{{ arg.name }}: Annotated[{{ arg.type }}, "{{ arg.description }}"]{% if 'default' in arg %} = {% if arg.type == "str" %}"{{ arg.default }}"{% else %}{{ arg.default }}{% endif %}{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) -> Any: """{{ tool.description }}""" return await globals().get("{{ client_name }}", None).call_tool("{{ tool.name }}", **locals())