add_step_filter
Skip specific files or directories during PHP debugging to avoid stepping through vendor code or other unwanted paths using pattern matching.
Instructions
Add a step filter to skip certain files/directories during stepping (e.g., vendor code)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Pattern to match (e.g., '/vendor/', '*.min.js', '/regex/') | |
| type | Yes | include = step into, exclude = skip | |
| description | No | Description of the filter |
Implementation Reference
- src/tools/advanced.ts:364-378 (registration)MCP tool registration for 'add_step_filter', including input schema (Zod) and handler function that calls StepFilter.addRule and returns success response.server.tool( 'add_step_filter', 'Add a step filter to skip certain files/directories during stepping (e.g., vendor code)', { pattern: z.string().describe("Pattern to match (e.g., '/vendor/', '*.min.js', '/regex/')"), type: z.enum(['include', 'exclude']).describe('include = step into, exclude = skip'), description: z.string().optional().describe('Description of the filter'), }, async ({ pattern, type, description }) => { const rule = ctx.stepFilter.addRule(pattern, type, description); return { content: [{ type: 'text', text: JSON.stringify({ success: true, rule }) }], }; } );
- src/session/step-filter.ts:37-56 (handler)Implementation of the addRule method in the StepFilter class, which creates a unique filter rule, stores it in the rules Map, logs it, and returns the rule object./** * Add a step filter rule */ addRule( pattern: string, type: 'include' | 'exclude', description?: string ): StepFilterRule { const id = `filter_${++this.ruleIdCounter}`; const rule: StepFilterRule = { id, pattern, type, enabled: true, description, }; this.rules.set(id, rule); logger.debug(`Step filter rule added: ${id} - ${type} ${pattern}`); return rule; }