You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/ollama-guide.mdx
+29-2Lines changed: 29 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,7 +168,7 @@ models:
168
168
169
169
### Model Capabilities and Tool Support
170
170
171
-
Some Ollama models support tools (function calling) which is required for Agent mode. However, not all models that claim tool support work correctly:
171
+
Some Ollama models support tools (function calling) which is required for Agent mode and MCP integration. However, not all models that claim tool support work correctly:
172
172
173
173
#### Checking Tool Support
174
174
@@ -181,6 +181,10 @@ models:
181
181
- tool_use # Add this to enable tools
182
182
```
183
183
184
+
<Info>
185
+
**MCP Tool Calling Compatibility**: Continue automatically handles message normalization for Ollama models to ensure compatibility with MCP tool calling. This includes fixing known issues with Mistral and Gemma models. No additional configuration is required.
186
+
</Info>
187
+
184
188
<Warning>
185
189
**Known Issue**: Some models like DeepSeek R1 may show "Agent mode is not
186
190
supported" or "does not support tools" even with capabilities configured. This
@@ -307,7 +311,19 @@ ollama pull deepseek-r1:32b
307
311
308
312
1. Add `capabilities: [tool_use]` to your model config
309
313
2. If still not working, the model may not actually support tools
310
-
3. Switch to a model with confirmed tool support (Llama 3.1, Mistral)
314
+
3. Switch to a model with confirmed tool support (Llama 3.1, Mistral, DeepSeek, Qwen)
315
+
316
+
#### MCP Tool Calling Errors
317
+
318
+
**Problem**: Errors like "Unexpected role 'system' after role 'tool'" (Mistral) or "Invalid 'tool_calls': unknown variant 'index'" (Gemma)
319
+
320
+
**Solution**: These errors are automatically handled by Continue's message normalization system. If you encounter them:
321
+
322
+
1. Ensure you're using Continue v1.1.x or later
323
+
2. The normalization happens automatically - no configuration needed
324
+
3. For persistent issues, see the [troubleshooting guide](/troubleshooting#ollama-model-errors-with-mcp-tool-calling)
- **Error handling**: If you encounter tool calling errors, check the [troubleshooting guide](/troubleshooting#ollama-model-errors-with-mcp-tool-calling)
397
+
398
+
For more information on MCP integration, see the [MCP guides](/guides/overview#mcp-integration-cookbooks).
399
+
373
400
## Conclusion
374
401
375
402
Ollama with Continue provides a powerful local development environment for AI-assisted coding. You now have complete control over your AI models, ensuring privacy and enabling offline development workflows.
Copy file name to clipboardExpand all lines: docs/troubleshooting.mdx
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,42 @@ If your keyboard shortcuts are not resolving, you may have other commands that a
82
82
83
83
## MCP Server connection issues
84
84
85
+
### Ollama model errors with MCP tool calling
86
+
87
+
Certain Ollama models may encounter errors during MCP tool calling operations, particularly after tool execution when the model processes tool results.
88
+
89
+
<AccordionGroup>
90
+
<Accordiontitle="Mistral/Ministral: 'Unexpected role system after role tool'">
91
+
**Error message:**
92
+
```
93
+
400 Bad Request: Unexpected role 'system' after role 'tool'
94
+
```
95
+
96
+
**Cause:** Mistral family models don't accept system messages appearing after tool messages in the conversation.
97
+
98
+
**Solution:** This issue is automatically handled by Continue's message normalization (added in v1.1.x). If you're still experiencing this error:
99
+
- Ensure you're using the latest version of Continue
100
+
- The normalization automatically reorders system messages before tool interactions
400 Bad Request: Invalid 'tool_calls': unknown variant 'index'
108
+
```
109
+
110
+
**Cause:** Gemma models don't recognize the 'index' field in tool_calls structure.
111
+
112
+
**Solution:** This issue is automatically handled by Continue's message normalization (added in v1.1.x). If you're still experiencing this error:
113
+
- Ensure you're using the latest version of Continue
114
+
- The normalization automatically removes the 'index' field from tool calls
115
+
- No configuration changes are required
116
+
117
+
**Note:** Some Gemma models may still experience compatibility issues with MCP tool calling even after normalization. Consider using alternative models like DeepSeek, Qwen, or Mistral for reliable MCP tool support.
118
+
</Accordion>
119
+
</AccordionGroup>
120
+
85
121
### "spawn ENAMETOOLONG" error on macOS
86
122
87
123
If you're seeing an error like `Failed to connect to "<MCP Server Name>"` with `Error: spawn ENAMETOOLONG` when using MCP servers on macOS, this is due to the environment being too large when spawning the MCP process.
0 commit comments