Skip to main content
Glama

add_step_filter

Add a step filter to skip specific files or directories during PHP debugging, such as vendor code, to focus debugging on relevant application code.

Instructions

Add a step filter to skip certain files/directories during stepping (e.g., vendor code)

Input Schema

NameRequiredDescriptionDefault
patternYesPattern to match (e.g., '/vendor/', '*.min.js', '/regex/')
typeYesinclude = step into, exclude = skip
descriptionNoDescription of the filter

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "description": { "description": "Description of the filter", "type": "string" }, "pattern": { "description": "Pattern to match (e.g., '/vendor/', '*.min.js', '/regex/')", "type": "string" }, "type": { "description": "include = step into, exclude = skip", "enum": [ "include", "exclude" ], "type": "string" } }, "required": [ "pattern", "type" ], "type": "object" }

Implementation Reference

  • Registers the 'add_step_filter' tool including schema, description, and inline handler that delegates to StepFilter.addRule
    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 }) }], }; } );
  • Handler function for 'add_step_filter' tool: validates input via schema, adds rule via StepFilter.addRule, returns JSON success response with rule details.
    async ({ pattern, type, description }) => { const rule = ctx.stepFilter.addRule(pattern, type, description); return { content: [{ type: 'text', text: JSON.stringify({ success: true, rule }) }], }; }
  • Zod input schema for 'add_step_filter' tool parameters.
    { 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'), },
  • Core implementation of adding a step filter rule: generates ID, creates rule object, stores in Map, logs, returns 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; }
  • TypeScript interface defining the structure of a StepFilterRule used by add_step_filter.
    export interface StepFilterRule { id: string; pattern: string; type: 'include' | 'exclude'; enabled: boolean; description?: string; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kpanuragh/xdebug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server