strapi_rest
Execute GET, POST, PUT, and DELETE requests against Strapi endpoints to read, create, update, or delete content, with explicit authorization required for write operations.
Instructions
Execute REST API requests against Strapi endpoints. IMPORTANT: All write operations (POST, PUT, DELETE) require explicit user authorization via the userAuthorized parameter.
Reading Data
params: { populate: ['SEO'] } // Populate a component params: { populate: { SEO: { fields: ['Title', 'seoDescription'] } } } // With field selection params: { filters: { title: { $contains: 'search' } } } // Filter results params: { sort: ['createdAt:desc'] } // Sort results params: { pagination: { page: 1, pageSize: 10 } } // Pagination
Writing Data (REQUIRES userAuthorized: true)
body: { data: { componentName: { Title: 'value' }, // Single component componentName: [{ field: 'value' }] // Repeatable component } }
Debugging Guide
404 Error: Check plural/singular form, use documentId not numeric id
400 Error: Check if data wrapper is present in body
405 Error: Check endpoint format (/articles not /article)
URL Errors: Validate URLs with webtools first
ID Problems: Use documentId for Strapi v5
Strapi v5 Specifics
Use documentId instead of numeric id
Direct attribute access (no nested attributes)
No data wrapper in GET responses
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"server": "<server>",
"endpoint": "<endpoint>"
},
"name": "strapi_rest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Request body for POST/PUT requests. For components, use: { data: { componentName: { field: 'value' } } } for single components or { data: { componentName: [{ field: 'value' }] } } for repeatable components | |
| method | No | HTTP method to use | GET |
| params | No | Optional query parameters for GET requests. For components, use populate: ['componentName'] or populate: { componentName: { fields: ['field1'] } } | |
| server | Yes | The name of the server to connect to | |
| endpoint | Yes | The API endpoint (e.g., 'api/articles') | |
| userAuthorized | No | REQUIRED for POST/PUT/DELETE operations. Client MUST obtain explicit user authorization before setting this to true. |