Skip to main content
Glama
FOX2920

WeWork MCP Server

by FOX2920

search_projects

Search WeWork projects by name to find relevant project information. Enter search text to retrieve matching projects with configurable result limits.

Instructions

Tìm kiếm dự án theo tên

Args:
    search_text: Text để tìm kiếm trong tên dự án
    limit: Số lượng kết quả tối đa (default: 10)

Returns:
    Danh sách các dự án phù hợp

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_textYes
limitNo

Implementation Reference

  • The primary MCP tool handler for 'search_projects'. Decorated with @mcp.tool(), it implements the core logic: validates client, searches via WeWorkClient.search_projects(), formats results with success/error handling.
    @mcp.tool()
    def search_projects(search_text: str, limit: int = 10) -> Dict[str, Any]:
        """
        Tìm kiếm dự án theo tên
        
        Args:
            search_text: Text để tìm kiếm trong tên dự án
            limit: Số lượng kết quả tối đa (default: 10)
        
        Returns:
            Danh sách các dự án phù hợp
        """
        try:
            if not wework_client:
                return {'error': 'WeWork client not initialized'}
            
            logger.info(f"Searching projects with text: {search_text}")
            results = wework_client.search_projects(search_text=search_text, limit=limit)
            
            return {
                'success': True,
                'search_text': search_text,
                'results': results,
                'count': len(results)
            }
        except Exception as e:
            logger.error(f"Error in search_projects: {e}")
            return {'error': str(e), 'success': False}
  • The @mcp.tool() decorator registers the search_projects function as an MCP tool.
    @mcp.tool()
  • Input/output schema defined by type hints (search_text: str, limit: int = 10 -> Dict[str, Any]) and comprehensive docstring describing args and returns.
    def search_projects(search_text: str, limit: int = 10) -> Dict[str, Any]:
        """
        Tìm kiếm dự án theo tên
        
        Args:
            search_text: Text để tìm kiếm trong tên dự án
            limit: Số lượng kết quả tối đa (default: 10)
        
        Returns:
            Danh sách các dự án phù hợp
        """
  • Supporting helper method WeWorkClient.search_projects() that fetches all projects and performs fuzzy/exact matching based on search_text, returning limited list of matching projects.
    def search_projects(self, search_text: str, limit: int = 10) -> List[Dict]:
        """
        Tìm kiếm projects theo tên
        """
        projects = self.fetch_projects()
        if not projects:
            return []
        
        # Tìm projects phù hợp
        matches = []
        for project in projects:
            project_name = project['name'].lower()
            search_lower = search_text.lower()
            
            # Exact match hoặc partial match
            if search_lower in project_name or project_name in search_lower:
                matches.append({
                    'project': project,
                    'similarity': 1.0 if search_lower == project_name else 0.8
                })
            else:
                # Sử dụng find_best_project_match
                _, similarity = self.find_best_project_match(search_text, [project])
                if similarity > 0.3:
                    matches.append({
                        'project': project,
                        'similarity': similarity
                    })
        
        # Sắp xếp theo similarity và giới hạn kết quả
        matches.sort(key=lambda x: x['similarity'], reverse=True)
        return [match['project'] for match in matches[:limit]]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. While it mentions the tool returns a list of matching projects, it doesn't describe important behavioral aspects like whether this is a read-only operation, how results are sorted, what happens with empty searches, or any rate limits. For a search tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately concise. It uses clear sections (Args, Returns) with bullet-like formatting, presents essential information upfront, and avoids unnecessary elaboration. Every sentence serves a purpose, though the formatting could be slightly more polished.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and parameters but lacks important context about behavioral traits, usage guidelines relative to siblings, and output format details. The absence of an output schema means the description should ideally explain more about what 'Danh sách các dự án phù hợp' (List of matching projects) contains.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful semantic context for both parameters beyond what the input schema provides. The schema has 0% description coverage, but the description explains that 'search_text' is 'Text để tìm kiếm trong tên dự án' (Text to search within project names) and 'limit' is 'Số lượng kết quả tối đa' (Maximum number of results) with a default value. This compensates well for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Tìm kiếm dự án theo tên' (Search projects by name). This is a specific verb+resource combination that indicates searching projects using name-based criteria. However, it doesn't explicitly differentiate from sibling tools like 'find_project_by_name' or 'analyze_project_tasks,' which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'find_project_by_name' and 'analyze_project_tasks' available, there's no indication of when this search tool is preferred, what its limitations are, or any prerequisites for use. This leaves the agent without contextual usage information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/FOX2920/Aplus-MCP'

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