Skip to content

Commit c6741a5

Browse files
Remove unused timeout parameter from django_shell (#11)
1 parent 71dd306 commit c6741a5

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
1818

1919
## [Unreleased]
2020

21+
### Removed
22+
23+
- Removed unused `timeout` parameter from django_shell tool, to prevent potential robot confusion.
24+
2125
## [0.3.0]
2226

2327
### Changed
2428

25-
- Removed custom formatting for QuerySets and iterables in shell output. QuerySets now display as `<QuerySet [...]>` and lists show their standard `repr()` instead of truncated displays with "... and X more items". This makes output consistent with standard Django/Python shell behavior and should hopefully not confused the robots.
29+
- Removed custom formatting for QuerySets and iterables in shell output. QuerySets now display as `<QuerySet [...]>` and lists show their standard `repr()` instead of truncated displays with "... and X more items". This makes output consistent with standard Django/Python shell behavior and should hopefully not confuse the robots.
2630

2731
### Fixed
2832

src/mcp_django_shell/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
@mcp.tool
20-
async def django_shell(code: str, ctx: Context, timeout: int | None = None) -> str:
20+
async def django_shell(code: str, ctx: Context) -> str:
2121
"""Execute Python code in a stateful Django shell session.
2222
2323
Django is pre-configured and ready to use with your project. You can import and use any Django
@@ -42,7 +42,7 @@ async def django_shell(code: str, ctx: Context, timeout: int | None = None) -> s
4242
)
4343

4444
try:
45-
result = await shell.execute(code, timeout=timeout)
45+
result = await shell.execute(code)
4646

4747
logger.debug(
4848
"django_shell execution completed - request_id: %s, result type: %s",

src/mcp_django_shell/shell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def reset(self):
4343
self.globals = {}
4444
self.history = []
4545

46-
async def execute(self, code: str, timeout: int | None = None) -> Result:
46+
async def execute(self, code: str) -> Result:
4747
"""Execute Python code in the Django shell context (async wrapper).
4848
4949
This async wrapper enables use from FastMCP and other async contexts.
@@ -55,9 +55,9 @@ async def execute(self, code: str, timeout: int | None = None) -> Result:
5555
errors.
5656
"""
5757

58-
return await sync_to_async(self._execute)(code, timeout)
58+
return await sync_to_async(self._execute)(code)
5959

60-
def _execute(self, code: str, timeout: int | None = None) -> Result:
60+
def _execute(self, code: str) -> Result:
6161
"""Execute Python code in the Django shell context (synchronous).
6262
6363
Attempts to evaluate code as an expression first (returning a value),

0 commit comments

Comments
 (0)