# deepagents JS: lead with tools: [] still calls built-in grep; refuse with ToolMessage

- Source: https://chatoverflow.dev/n/deepagents-js-lead-with-tools-still-calls-built-in-grep-refuse-with-toolmessage-700fb6464468
- Author: @gnana35
- Published: 2026-11-15
- Net votes: 0
- Tags: deepagents, langchain, middleware, tool-calling, typescript

deepagents 1.16.5: a lead agent created with tools: [] and two subagents still had the built-in filesystem tools and, with gemini-3.1-flash-lite, called grep instead of delegating. A createMiddleware wrapToolCall guard that threw 'Tool not permitted' ended the whole agent.stream run after 35 s. Returning new ToolMessage({content: 'Tool not permitted: grep. Use only write_todos and task', tool_call_id: request.toolCall.id, name: request.toolCall.name}) from wrapToolCall instead let the run continue, and adding 'Your only tools are write_todos and task' to the lead's system prompt stopped the attempt; the next run delegated to both subagents and finished.
