asana_search_projects
Search Asana projects by name pattern within a workspace to find specific projects using regular expressions.
Instructions
Search for projects in Asana using name pattern matching
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace to search in | |
| name_pattern | Yes | Regular expression pattern to match project names | |
| archived | No | Only return archived projects | |
| opt_fields | No | Comma-separated list of optional fields to include |
Implementation Reference
- src/tool-handler.ts:111-122 (handler)The switch case handler that processes the tool call for 'asana_search_projects', destructures arguments (workspace, name_pattern, archived, opts), calls asanaClient.searchProjects, and returns the JSON stringified response.case "asana_search_projects": { const { workspace, name_pattern, archived = false, ...opts } = args; const response = await asanaClient.searchProjects( workspace, name_pattern, archived, opts ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- src/tools/project-tools.ts:3-29 (schema)Defines the Tool specification including name, description, and inputSchema with properties for workspace (required), name_pattern (required), archived (optional boolean), and opt_fields (optional string).export const searchProjectsTool: Tool = { name: "asana_search_projects", description: "Search for projects in Asana using name pattern matching", inputSchema: { type: "object", properties: { workspace: { type: "string", description: "The workspace to search in" }, name_pattern: { type: "string", description: "Regular expression pattern to match project names" }, archived: { type: "boolean", description: "Only return archived projects", default: false }, opt_fields: { type: "string", description: "Comma-separated list of optional fields to include" } }, required: ["workspace", "name_pattern"] } };
- src/tool-handler.ts:38-61 (registration)Registers searchProjectsTool (line 40) in the all_tools array, which is used to generate the list_of_tools exported for MCP tool discovery.const all_tools: Tool[] = [ listWorkspacesTool, searchProjectsTool, searchTasksTool, getTaskTool, createTaskTool, getStoriesForTaskTool, updateTaskTool, getProjectTool, getProjectTaskCountsTool, getProjectSectionsTool, createTaskStoryTool, addTaskDependenciesTool, addTaskDependentsTool, createSubtaskTool, getMultipleTasksByGidTool, getProjectStatusTool, getProjectStatusesForProjectTool, createProjectStatusTool, deleteProjectStatusTool, setParentForTaskTool, getTasksForTagTool, getTagsForWorkspaceTool, ];
- src/asana-client-wrapper.ts:31-38 (helper)Core implementation: Calls Asana API to get projects in workspace (with archived filter and opts), creates case-insensitive RegExp from namePattern, filters projects by matching name, returns filtered list.async searchProjects(workspace: string, namePattern: string, archived: boolean = false, opts: any = {}) { const response = await this.projects.getProjectsForWorkspace(workspace, { archived, ...opts }); const pattern = new RegExp(namePattern, 'i'); return response.data.filter((project: any) => pattern.test(project.name)); }
- src/tool-handler.ts:64-78 (registration)Includes 'asana_search_projects' (line 66) in READ_ONLY_TOOLS array, used to filter available tools when READ_ONLY_MODE is enabled.const READ_ONLY_TOOLS = [ 'asana_list_workspaces', 'asana_search_projects', 'asana_search_tasks', 'asana_get_task', 'asana_get_task_stories', 'asana_get_project', 'asana_get_project_task_counts', 'asana_get_project_status', 'asana_get_project_statuses', 'asana_get_project_sections', 'asana_get_multiple_tasks_by_gid', 'asana_get_tasks_for_tag', 'asana_get_tags_for_workspace' ];