create_test_folder
Generate a test folder with a specified name on Android Debug Bridge MCP for organizing automation and testing environments efficiently.
Instructions
Create a test folder with the specified name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test_name | Yes | Name of the test folder to create |
Implementation Reference
- src/tools/handlers.ts:49-63 (handler)The main handler function that extracts test_name from args, computes the test path using path.join and getBaseTestPath, creates the directory with createDirectory, and returns a text content response.create_test_folder: async (args: any) => { const { test_name } = args as { test_name: string }; const testPath = path.join(getBaseTestPath(), test_name); await createDirectory(testPath); return { content: [ { type: 'text', text: `Test folder created: ${testPath}`, }, ], }; },
- src/tools/definitions.ts:2-15 (schema)Defines the tool metadata including name, description, and inputSchema requiring a 'test_name' string parameter.{ name: 'create_test_folder', description: 'Create a test folder with the specified name', inputSchema: { type: 'object', properties: { test_name: { type: 'string', description: 'Name of the test folder to create', }, }, required: ['test_name'], }, },
- src/index.ts:26-30 (registration)Registers the list of tool definitions, including create_test_folder, for the ListTools MCP request.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolDefinitions, }; });
- src/index.ts:32-46 (registration)Registers the tool handlers object for CallTool MCP requests, dynamically dispatching to the handler for the specified tool name like create_test_folder.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const handler = toolHandlers[name as keyof typeof toolHandlers]; if (!handler) { throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`); } return await handler(args); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${errorMessage}`); } });
- src/utils/shell.ts:31-39 (helper)Cross-platform helper function used by the handler to create the test directory.export async function createDirectory(dirPath: string): Promise<void> { const platform = os.platform(); if (platform === 'win32') { execSync(`mkdir "${dirPath}"`, { encoding: 'utf8' }); } else { execSync(`mkdir -p "${dirPath}"`, { encoding: 'utf8' }); } }