get_file_or_folder_details
Fetch detailed metadata for a specific file or folder using its unique URL from DAV MCP Server, aiding in managing CalDAV, CardDAV, and WebDAV services effectively.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileUrl | Yes | The unique identifier (URL) of the file or folder to get details for. You can get this from 'list_my_files_and_folders'. |
Implementation Reference
- index.js:281-302 (handler)The handler function that executes the tool logic: logs into the WebDAV client and fetches detailed properties for the specified file or folder URL using fetchObjects.async ({ fileUrl }) => { try { await webDavClient.login(); // fetchObjects can be used with a full URL to an object to get its properties const objectProperties = await webDavClient.fetchObjects({ collection: fileUrl }); return { content: [{ type: "text", text: JSON.stringify(objectProperties, null, 2) }] }; } catch (error) { console.error(`Error in get_file_or_folder_details_from_${DAV_PROVIDER}:`, error); return { content: [{ type: "text", text: `Error getting WebDAV file metadata: ${JSON.stringify(error.message || error)}` }], isError: true }; } }
- index.js:277-279 (schema)Input schema defining the required 'fileUrl' parameter as a string with description.inputSchema: { fileUrl: z.string().describe("The unique identifier (URL) of the file or folder to get details for. You can get this from 'list_my_files_and_folders'."), },
- index.js:274-303 (registration)MCP server tool registration for 'get_file_or_folder_details_from_${DAV_PROVIDER}', including dynamic name based on DAV_PROVIDER, description, input schema, and handler reference. Conditionally registered only if webDavClient is available.`get_file_or_folder_details_from_${DAV_PROVIDER}`, { description: `Retrieves detailed properties for a specific file or folder from your ${DAV_PROVIDER} WebDAV storage. You must provide the full \`fileUrl\` of the item, which you can get from \`list_my_files_and_folders_from_${DAV_PROVIDER}\`. This is only available for providers that support WebDAV.`, inputSchema: { fileUrl: z.string().describe("The unique identifier (URL) of the file or folder to get details for. You can get this from 'list_my_files_and_folders'."), }, }, async ({ fileUrl }) => { try { await webDavClient.login(); // fetchObjects can be used with a full URL to an object to get its properties const objectProperties = await webDavClient.fetchObjects({ collection: fileUrl }); return { content: [{ type: "text", text: JSON.stringify(objectProperties, null, 2) }] }; } catch (error) { console.error(`Error in get_file_or_folder_details_from_${DAV_PROVIDER}:`, error); return { content: [{ type: "text", text: `Error getting WebDAV file metadata: ${JSON.stringify(error.message || error)}` }], isError: true }; } } );