Skip to main content
Glama
FOX2920

WeWork MCP Server

by FOX2920

find_project_by_name

Search for WeWork projects by name using similarity matching to find the most relevant project information based on specified thresholds.

Instructions

Tìm dự án theo tên với độ tương đồng Args: project_name: Tên dự án cần tìm threshold: Ngưỡng tương đồng tối thiểu (default: 0.3) Returns: Thông tin dự án phù hợp nhất

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_nameYes
thresholdNo

Implementation Reference

  • The handler function decorated with @mcp.tool(), which defines and registers the MCP tool. It fetches all projects, finds the best fuzzy match by name using WeWorkClient's find_best_project_match method, and returns the matching project or a list of available projects if no match above threshold.
    @mcp.tool() def find_project_by_name(project_name: str, threshold: float = 0.3) -> Dict[str, Any]: """ Tìm dự án theo tên với độ tương đồng Args: project_name: Tên dự án cần tìm threshold: Ngưỡng tương đồng tối thiểu (default: 0.3) Returns: Thông tin dự án phù hợp nhất """ try: if not wework_client: return {'error': 'WeWork client not initialized'} logger.info(f"Finding project by name: {project_name}") projects = wework_client.fetch_projects() if not projects: return { 'error': 'No projects available or failed to fetch projects', 'success': False } best_project, similarity_score = wework_client.find_best_project_match( project_name, projects, threshold ) if best_project: return { 'success': True, 'found': True, 'project': best_project, 'similarity_score': similarity_score, 'search_term': project_name } else: return { 'success': True, 'found': False, 'similarity_score': similarity_score, 'search_term': project_name, 'message': f'Không tìm thấy dự án phù hợp với "{project_name}" (ngưỡng: {threshold})', 'available_projects': [p.get('name', 'Unknown') for p in projects[:5]] # Show first 5 for reference } except Exception as e: logger.error(f"Error in find_project_by_name: {e}") return {'error': str(e), 'success': False}
  • The @mcp.tool() decorator registers the find_project_by_name function as an MCP tool.
    @mcp.tool()
  • Function signature defines input schema (project_name: str, threshold: float=0.3) and output as Dict[str, Any]. Docstring provides additional description.
    def find_project_by_name(project_name: str, threshold: float = 0.3) -> Dict[str, Any]:

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