get_file_metadata
Fetch metadata for files in Istedlal MCP Server by ID to access details like filename, mime_type, size, and processing status.
Instructions
Fetch metadata for a specific file by ID. Returns file details including filename, mime_type, size, processing_status, and storage info.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | ||
| tenant_id | Yes | ||
| project_id | Yes |
Implementation Reference
- src/tools/get_file_metadata.py:5-28 (handler)The core handler function that implements the get_file_metadata tool logic. Takes file_id, tenant_id, and project_id as parameters and returns a dictionary with file metadata including filename, mime_type, size, processing status, and storage info. Currently returns mock/placeholder data.
def get_file_metadata(file_id: str, tenant_id: str, project_id: str) -> dict[str, Any]: """ Fetch metadata for a specific file. Args: file_id: Unique identifier of the file tenant_id: Tenant context for authorization project_id: Project context for authorization Returns: File metadata object (placeholder until DB provider is connected) """ # Phase 1: Return mock data. Phase 2: Call PostgreSQL provider. return { "file_id": file_id, "tenant_id": tenant_id, "project_id": project_id, "filename": "placeholder.txt", "mime_type": "text/plain", "size_bytes": 0, "processing_status": "pending", "upload_timestamp": None, "storage_uri": None, } - src/tools/__init__.py:12-19 (registration)Registration of the get_file_metadata tool with the MCP (Model Context Protocol) server. The @mcp.tool decorator registers the function with the specified name, and the wrapper function delegates to the actual handler implementation.
@mcp.tool(name="get_file_metadata") def get_file_metadata_tool( file_id: str, tenant_id: str, project_id: str, ) -> dict: """Fetch metadata for a specific file by ID. Returns file details including filename, mime_type, size, processing_status, and storage info.""" return get_file_metadata(file_id, tenant_id, project_id)