WebMCP Projects Filter Tool
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
WebMCP Projects Filter Tool
Section titled “WebMCP Projects Filter Tool”Status
Section titled “Status”Draft - awaiting review
Background
Section titled “Background”The site hosts project documentation (Flappy Bird clones, image generation, etc.) under docs/projects/. As the portfolio grows, filtering by technology stack or project type becomes useful for agents assisting with project discovery.
Problem
Section titled “Problem”- Projects tagged by technology (Astro, MCP, AI, Python, etc.)
- No programmatic way to find “which projects use X technology?”
Implement WebMCP tool filter_projects_by_tech() to list projects matching a technology filter.
User Stories
Section titled “User Stories”US-1: Filter by Technology
Section titled “US-1: Filter by Technology”As an AI agent helping a visitor find relevant projects, I want to filter projects by tech stack.
Acceptance Criteria:
- Agent calls
filter_projects_by_tech(tech)with technology name - Tool returns matching projects as JSON array
- Each result includes: title, slug, tech tags
Functional Requirements
Section titled “Functional Requirements”| ID | Requirement |
|---|---|
| FR-001 | Tool name: filter_projects_by_tech |
| FR-002 | Input: tech parameter (enum of known tech stacks or free string) |
| FR-003 | Output: JSON array { title, slug, technologies } |
| FR-004 | readOnlyHint: true |
| FR-005 | Case-insensitive tech matching |
Design
Section titled “Design”Input Schema (Enum-based, Recommended)
Section titled “Input Schema (Enum-based, Recommended)”inputSchema: { type: "object", properties: { tech: { type: "string", enum: ["astro", "starlight", "mcp", "python", "vue", "firebird", "symfony", "docker"], description: "Technology to filter by" } }, required: ["tech"]}Rationale: Enum provides exact matches and guides agents to valid values.
Tool Registration
Section titled “Tool Registration”const PROJECTS_DATA = [/* build-time collection */];
document.modelContext.registerTool({ name: "filter_projects_by_tech", description: "Filter portfolio projects by technology stack. Returns matching projects with title, slug, and tech tags.", inputSchema: { /* above */ }, execute: async ({ tech }) => { const matches = PROJECTS_DATA.filter(p => p.technologies.some(t => t.toLowerCase().includes(tech.toLowerCase())) ); return matches.map(p => ({ title: p.title, slug: p.slug, technologies: p.technologies })); }, annotations: { readOnlyHint: true }});Test Plan
Section titled “Test Plan”| Test | Input | Expected |
|---|---|---|
| Match | “astro” | Returns Astro-based projects |
| No match | “rust” | Returns [] |
| Partial match | “pytho” | Returns Python projects (if fuzzy) |
Dependencies
Section titled “Dependencies”- Projects must have
technologiesfrontmatter field defined