Story: 2.3 - Validate & Test Tags API
Status: In Progress
Test Suite: test-tags-validation.js
Comprehensive validation testing for all 5 Tags API methods implemented in the n8n Workflow Builder MCP Server:
get_tags- List all tags with cursor-based paginationget_tag- Retrieve specific tag by IDcreate_tag- Create new tagsupdate_tag- Update tag namesdelete_tag- Remove tags
You need access to a live n8n instance (v1.82.3 or later) with:
- Valid API key
- Permissions to create, update, and delete tags
Same as previous test suites - use either .config.json or .env file.
npm run build# 1. Build the project
npm run build
# 2. Start the MCP server (if not already running)
npm start &
# 3. Wait for server to start
sleep 3
# 4. Run tags validation tests
node test-tags-validation.jsTests tag listing and pagination:
- List all tags
- Response structure validation
- Pagination limit
- Cursor-based pagination
Tests tag creation:
- Create tag with unique name
- Response structure validation
- Duplicate name handling (409 error expected)
Tests individual tag retrieval:
- Retrieve tag by ID
- Structure validation
- 404 error for non-existent ID
Tests tag name updates:
- Update tag name
- 404 error for non-existent ID
Tests tag deletion:
- Delete and verify removal
- 404 error for non-existent ID
{
"id": "string",
"name": "string",
"createdAt": "ISO 8601 date",
"updatedAt": "ISO 8601 date"
}{
"data": [
{
"id": "string",
"name": "string",
"createdAt": "ISO 8601 date",
"updatedAt": "ISO 8601 date"
}
],
"nextCursor": "string or null"
}Tags must have unique names within an n8n instance. Attempting to create a duplicate will result in a 409 Conflict error.
Similar to executions API:
- Uses opaque cursor strings
nextCursorfield indicates more results available- Efficient for large tag lists
Tests validate proper error responses:
- 404 Not Found for non-existent tag IDs
- 409 Conflict for duplicate tag names
- Proper error message format
The test suite automatically cleans up all created tags after completion (unless runCleanup: false).
Cleanup behavior:
- All tags created during tests are deleted
- Uses unique prefix
TagTest_for identification - Automatic retry logic for failed deletions
If tests fail with duplicate name errors, there may be leftover test tags from previous runs.
Solution:
# Manually clean up test tags through n8n interface
# Or set runCleanup: true and re-run testsIf the duplicate name test doesn't get a 409 error, check n8n version compatibility.
Possible causes:
- Some n8n versions may allow duplicate tag names
- API behavior may differ between versions
Same GitHub Actions pattern as previous test suites.
- API Documentation:
docs/n8n-api-docs/30-TAGS-API.md - Pagination Guide:
docs/n8n-api-docs/03-PAGINATION.md - Implementation:
src/services/n8nApiWrapper.ts - MCP Tool Definitions:
src/index.ts
Total Tests: 14
- get_tags: 4 tests
- create_tag: 3 tests
- get_tag: 3 tests
- update_tag: 2 tests
- delete_tag: 2 tests
Target: 100% pass rate