Skip to content

Skills#18

Open
markhuot wants to merge 18 commits intomainfrom
skills
Open

Skills#18
markhuot wants to merge 18 commits intomainfrom
skills

Conversation

@markhuot
Copy link
Collaborator

No description provided.

- Add params parameter to callTool() method for passing path parameters
- Remove manual request manipulation in EntryTypesController and SectionsController
- Switch from mapper() to argumentsMapper() for proper callable handling
- Add castNumericStringsToIntegers() helper for query param type conversion
- Update controllers to use Craft::$container->get() for tool instantiation
- Fix EntryTypesControllerTest to use proper array query string notation

Controllers now pass path params cleanly via callTool($tool->method(...), ['id' => $value])
instead of manipulating $this->request->setBodyParams() directly.
Replace custom castNumericStringsToIntegers() method with Valinor's built-in
allowScalarValueCasting() feature. This provides more comprehensive scalar type
conversion (strings to ints/floats/bools) with better type safety and validation.

- Add allowScalarValueCasting() to MapperBuilder chain
- Remove 13 lines of custom casting logic
- Handles HTTP request string values to typed parameters automatically
- Keep human-readable descriptions as inline parameter comments
- Move complex type information (union types, array shapes) to @param tags
- Improve readability of siteSettings parameter documentation with multi-line format
- Fixes PHPStan type recognition for CreateSection and UpdateSection tools
- Remove use statements for PhpMcp\Server\Attributes\McpTool and Schema
- Add file system safety rule to AGENTS.md
- First step toward converting to PHPStan-only type system
- Remove McpTool and Schema attributes
- Move descriptions to method docblocks
- Keep parameter descriptions as inline comments
- Maintain PHPStan type annotations in @param tags
- GetFieldTypes, GetEntryTypes, UpdateDraft, CreateFieldLayout
- GetFields, GetSections, DeleteField, DeleteSection
- Remove McpTool and Schema attributes
- Move descriptions to method docblocks
- Convert final 6 tools: CreateEntryType, CreateField, UpdateEntry, UpdateEntryType, UpdateField, UpdateFieldLayout
- All 25 tools now use PHPStan docblock types instead of MCP Schema attributes
- Remove all McpTool and Schema attributes from all tool files
- Maintain proper PHPStan type annotations in @param and @return tags
- Keep human-readable parameter descriptions as inline comments

All tools now follow the established pattern documented in AGENTS.md
- Add 5 new controllers (Fields, Entries, Drafts, FieldLayouts, Sites)
- Register 30+ new API routes in Plugin.php
- Create comprehensive HTTP API documentation
- All endpoints follow consistent RESTful pattern
- Automatic parameter validation via Valinor
- Zero code duplication - delegates to existing tool classes

Controllers:
- FieldsController: create, list, update, delete, get types
- EntriesController: create, get, search, update, delete
- DraftsController: create, update, apply
- FieldLayoutsController: create, get, update
- SitesController: list

Documentation:
- docs/http-api.md: Complete API reference with examples
- docs/routes.md: Quick reference table of all routes
- docs/http-endpoints-implementation.md: Implementation details
- SKILLS.md: Updated with comprehensive endpoint documentation

All 25 tools from src/tools/ now accessible via RESTful HTTP API
- Reduce SKILLS.md from 787 to 119 lines (~85% token reduction)
- Add concise 2-3 sentence summaries for each of 25 MCP tools
- Create SKILLS/ directory with detailed documentation per tool
- Organize tools into 6 logical categories:
  * Content Management (5 tools)
  * Draft Management (3 tools)
  * Section Management (4 tools)
  * Entry Type Management (4 tools)
  * Field Management (5 tools)
  * Field Layout Management (3 tools)
  * Site Management (1 tool)

Each SKILLS/{tool}.md file includes:
- Complete parameter specifications
- Return value documentation
- JSON usage examples
- Best practices and notes

Benefits:
- Minimal token usage for overview queries
- Complete details available when needed
- Better organization and navigation
- Easier maintenance per tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant