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: README.md
+115Lines changed: 115 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,121 @@ class LaravelFactoriesToolkit implements Toolkit
129
129
130
130
***
131
131
132
+
## Dynamic Tool Management
133
+
134
+
Laravel Loop supports dynamic tool management, allowing you to add or remove MCP tools at runtime from anywhere in your Laravel application. This enables powerful features like:
135
+
136
+
- Enabling/disabling tools based on user roles or permissions
137
+
- Managing tools through administrative interfaces
138
+
- Dynamically adjusting available functionality based on application state
139
+
- Providing temporary access to tools for maintenance or debugging
140
+
141
+
### API Reference
142
+
143
+
#### Adding Tools Dynamically
144
+
145
+
```php
146
+
// Add a tool at runtime
147
+
Loop::addTool(new MyCustomTool());
148
+
149
+
// Add multiple tools with method chaining
150
+
Loop::addTool(new ToolOne())
151
+
->addTool(new ToolTwo())
152
+
->addTool(new ToolThree());
153
+
```
154
+
155
+
#### Removing Tools Dynamically
156
+
157
+
```php
158
+
// Remove a tool by name
159
+
Loop::removeTool('my-custom-tool');
160
+
161
+
// Remove multiple tools with method chaining
162
+
Loop::removeTool('tool-one')
163
+
->removeTool('tool-two')
164
+
->removeTool('tool-three');
165
+
```
166
+
167
+
#### Clearing All Tools
168
+
169
+
```php
170
+
// Remove all registered tools and toolkits
171
+
Loop::clear();
172
+
```
173
+
174
+
### Common Use Cases
175
+
176
+
#### Feature Toggle via HTTP Controller
177
+
178
+
```php
179
+
// User enables integration in web UI
180
+
public function enableStripeIntegration(Request $request)
0 commit comments