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: src/DescribeFilamentResourceTool.php
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ public function build(): PrismTool
38
38
{
39
39
returnapp(PrismTool::class)
40
40
->as($this->getName())
41
-
->for('Describes the structure, fields, columns, actions, and relationships for a given Filament resource. Always call the list_filament_resources tool before calling this tool.')
41
+
->for('Describes the structure, fields, columns, actions, and relationships for a given Filament resource. Must call the list_filament_resources tool before calling this tool.')
42
42
->withStringParameter('resource', 'The class name of the resource to describe.', required: true)
43
43
->using(function (string$resource) {
44
44
returnjson_encode($this->describe($resource));
@@ -180,10 +180,15 @@ public function makeFilamentTranslatableContentDriver(): ?TranslatableContentDri
180
180
181
181
return [
182
182
'columns' => $columns,
183
-
'filters' => array_values($filters),// Re-index the array
183
+
'filters' => array_values($filters),
184
184
'actions' => [
185
185
'bulk' => $bulkActions,
186
186
],
187
+
'pagination' => [
188
+
'total' => 'Total number of records (int)',
189
+
'per_page' => 'Number of records per page (int)',
190
+
'current_page' => 'Current page number (int)',
191
+
],
187
192
];
188
193
} catch (Exception$e) {
189
194
Log::error("Error extracting table schema for resource {$resource}: {$e->getMessage()}");
@@ -212,8 +217,7 @@ public function mapFilterType(BaseFilter $filter): string
212
217
returnmatch (true) {
213
218
$filterinstanceof TernaryFilter => 'boolean',
214
219
$filterinstanceof SelectFilter => 'select',
215
-
// Add more mappings as needed
216
-
default => class_basename($filter), // Fallback to class name
Copy file name to clipboardExpand all lines: src/GetFilamentResourceDataTool.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,10 @@ public function build(): PrismTool
27
27
{
28
28
returnapp(PrismTool::class)
29
29
->as($this->getName())
30
-
->for('Gets the data for a given Filament resource, applying optional filters (try to use them). Always call the describe_filament_resource tool before calling this tool. Always try to use the available filters to get the data you need.')
30
+
->for('Retrieves paginated data from a Filament resource with optional filtering. Response includes page count and total record count. Must call describe_filament_resource first to understand available filters and structure. Use filters to narrow results when possible for better performance.')
31
31
->withStringParameter('resource', 'The resource class name of the resource to get data for, from the list_filament_resources tool.')
32
32
->withStringParameter('filters', 'JSON string of filters to apply (e.g., \'{"status": "published", "author_id": [1, 2]}\').', required: false)
33
-
->withNumberParameter('perPage', 'The resource data is paginated. This is the number of records per page. It defaults to 10', required: false)
33
+
->withNumberParameter('perPage', 'The resource data is paginated. This is the number of records per page. It defaults to 10. Maximum is 100.', required: false)
34
34
->withNumberParameter('page', 'The resource data is paginated. This is the page the paginated results should be from.', required: false)
0 commit comments