Skip to main content
Glama
moma1992

Yaizu Smart City MCP Server

by moma1992

get_api_details

Retrieve detailed information about specific APIs available through the Yaizu Smart City MCP Server to understand functionality and usage requirements.

Instructions

特定のAPIの詳細情報を取得します。

Args: api_name: API名またはファイル名(拡張子なし)

Returns: str: API詳細情報

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_nameYes

Implementation Reference

  • The primary handler function for the 'get_api_details' MCP tool. It loads API documentation using doc_manager, searches for the specified API, and formats detailed information including attributes, examples, endpoints, and metadata. The @mcp.tool() decorator registers it as an MCP tool, deriving schema from the function signature and docstring.
    @mcp.tool() async def get_api_details(api_name: str) -> str: """ 特定のAPIの詳細情報を取得します。 Args: api_name: API名またはファイル名(拡張子なし) Returns: str: API詳細情報 """ try: # まずファイル名として検索 doc = doc_manager.load_api_docs(api_name) if not doc: # API名で検索 results = doc_manager.search_apis(api_name) if results: api = results[0]['api'] doc = api else: return f"「{api_name}」というAPIが見つかりませんでした。" # 詳細情報の整形 output = f"# API詳細情報\n\n" if isinstance(doc, dict): # データモデル形式の場合 if 'dataModelName' in doc: output += f"## {doc['dataModelName']}\n\n" output += f"**FIWAREサービス**: {doc.get('fiwareService', '')}\n" output += f"**サービスパス**: {doc.get('fiwareServicePath', '')}\n" output += f"**エンティティタイプ**: {doc.get('entityType', '')}\n" output += f"**エンティティIDパターン**: {doc.get('entityIdPattern', '')}\n\n" # 属性情報 if 'attributes' in doc: output += f"### 属性 ({len(doc['attributes'])}個)\n" for attr_key, attr_info in doc['attributes'].items(): output += f"- **{attr_key}** ({attr_info.get('name', '')}): {attr_info.get('description', '')} - {attr_info.get('type', '')}\n" output += "\n" # リクエスト例 if 'example_request' in doc: output += "### リクエスト例\n```json\n" output += json.dumps(doc['example_request'], ensure_ascii=False, indent=2) output += "\n```\n\n" # レスポンス例 if 'example_response' in doc: output += "### レスポンス例\n```json\n" output += json.dumps(doc['example_response'], ensure_ascii=False, indent=2)[:2000] output += "\n```\n\n" return output # 従来形式の場合 # タイトル if 'title' in doc: output += f"## {doc['title']}\n\n" elif 'name' in doc: output += f"## {doc['name']}\n\n" # 基本情報 if 'description' in doc: output += f"**説明**: {doc['description']}\n\n" if 'category' in doc: output += f"**カテゴリ**: {doc['category']}\n\n" # エンドポイント if 'endpoints' in doc and doc['endpoints']: output += "### エンドポイント\n" for endpoint in doc['endpoints']: output += f"- `{endpoint}`\n" output += "\n" # データモデル if 'data_models' in doc and doc['data_models']: output += "### データモデル\n```json\n" output += json.dumps(doc['data_models'], ensure_ascii=False, indent=2) output += "\n```\n\n" # パラメータ if 'parameters' in doc and doc['parameters']: output += "### パラメータ\n" for param in doc['parameters']: if isinstance(param, dict): output += f"- **{param.get('name', 'unknown')}**: {param.get('description', '')}\n" output += "\n" # APIs配列がある場合 if 'apis' in doc: output += f"### 含まれるAPI ({len(doc['apis'])}個)\n" for api in doc['apis'][:10]: # 最大10個まで表示 output += f"- {api.get('name', '名称不明')}: {api.get('description', '')[:50]}...\n" output += "\n" # メタデータ if 'metadata' in doc: output += "### メタデータ\n" output += f"- **取得日時**: {doc['metadata'].get('scraped_at', '不明')}\n" output += f"- **ソースURL**: {doc['metadata'].get('source_url', '不明')}\n" output += f"- **バージョン**: {doc['metadata'].get('version', '不明')}\n" return output except Exception as e: logger.error(f"詳細取得エラー: {e}") return f"❌ API詳細の取得中にエラーが発生しました: {str(e)}"

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/moma1992/smartcity-mcp'

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