Skip to main content
Glama
kkawailab

MLIT Data Platform MCP Server

by kkawailab

get_zipfile_download_url

Compress multiple files into a ZIP archive and generate a temporary download URL valid for 60 seconds, enabling bulk file retrieval from the MLIT Data Platform.

Instructions

複数の付属ファイルをZIP形式で圧縮し、圧縮ファイルのダウンロードURLを取得する。URLの有効期限は60秒。

            使い方:
            - まとめて取得したい複数ファイルの `id` と、ZIP内に格納する `original_path`(パス)を指定します。
            - search / data で取得した `files` から必要な id / original_path を選択して投入してください。
            - 本ツールは2通りに対応:
            (A) `files=[{id, original_path}, ...]` を直接渡す
            (B) `dataset_id` と `data_id` を渡す(ツール側で `files` を参照しZIP作成)

            例:
            - IFCを3本まとめてZIPで取得:
            files=[
                { id:"<id1>", original_path:"ICON/.../モデルA.ifc" },
                { id:"<id2>", original_path:"ICON/.../モデルB.ifc" },
                { id:"<id3>", original_path:"ICON/.../モデルC.ifc" },
            ]

            - データIDから付属ファイルをZIP化(簡易):
            dataset_id="cals_construction", data_id="<searchで取得したid>"

            注意:
            - ZIPのダウンロードURLは **60秒間のみ有効** です。取得後すぐにダウンロード処理を開始してください。
            - GraphQLは `zipfileDownloadURL(files:[FileInputClass]): String`。`files` の `id` / `original_path` は `DataClass.files` を用います。
            - 大容量ZIPはクライアント側のタイムアウト設定にも注意してください。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNoZIP化するファイルの配列
dataset_idNoデータセットID
data_idNoデータID

Implementation Reference

  • Handler in src/server.py for get_zipfile_download_url tool.
    elif name == "get_zipfile_download_url":
        p = ZipfileDownloadURLInput.model_validate(arguments)
        if p.files:
            files = [FileRef(id=f.id, original_path=f.original_path) for f in p.files]
            data = await client.zipfile_download_url(files=files)
        else:
            data = await client.zipfile_download_url_from_data(
                dataset_id=str(p.dataset_id), data_id=str(p.data_id)  # type: ignore
            )
  • Implementation of zipfile_download_url in src/client.py using GraphQL builder.
    async def zipfile_download_url(self, *, files: List[FileRef]) -> Dict[str, Any]:
        if not files:
            return {"zipfileDownloadURL": None}
        q = self.build_zipfile_download_url(files=files)
        return await self.post_query(q)
    
    async def zipfile_download_url_from_data(self, *, dataset_id: str, data_id: str) -> Dict[str, Any]:
        files = await self.get_data_files(dataset_id=dataset_id, data_id=data_id)
        if not files:
            return {"zipfileDownloadURL": None}
        return await self.zipfile_download_url(files=files)
  • GraphQL query builder for zipfileDownloadURL.
    # ----- ZIPFILE DOWNLOAD URL -----
    def build_zipfile_download_url(self, *, files: List[FileRef]) -> str:
        def q(s: str) -> str:
            return '"' + s.replace('"', '\\"') + '"'
        items = ", ".join(
            "{ id: " + q(f.id) + ", original_path: " + q(f.original_path) + " }" for f in files
        )
        return f"""
        query {{
          zipfileDownloadURL(files: [{items}])
        }}
        """.strip()
Behavior5/5

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

With no annotations provided, the description carries full behavioral disclosure burden. It explicitly warns that download URLs are valid for only 60 seconds (critical operational constraint), notes client-side timeout risks for large ZIPs, and reveals the underlying GraphQL implementation structure.

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 with clear sections (purpose, usage, examples, warnings) and front-loaded critical information. It is slightly verbose with the GraphQL implementation detail at the end, which is unnecessary for tool selection, but overall efficiently organized.

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

Completeness4/5

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

Given no output schema and no annotations, the description adequately explains the return value (URL string) and operational constraints (60s expiry, large file timeouts). It could be improved by mentioning error conditions (e.g., invalid file IDs) or whether the ZIP resource persists after URL expiry.

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

Parameters5/5

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

Despite 100% schema coverage (baseline 3), the description adds substantial semantic value: it explains that files and dataset_id/data_id represent mutually exclusive usage modes, clarifies that original_path determines the storage path inside the ZIP, and provides concrete IFC file examples showing valid input structures.

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

Purpose5/5

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

The opening sentence clearly states the tool compresses multiple attachments into ZIP format and retrieves a download URL, with the critical detail that the URL expires in 60 seconds. This clearly distinguishes it from sibling get_file_download_urls which handles individual files.

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

Usage Guidelines5/5

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

The '使い方' section explicitly documents two distinct invocation patterns: (A) passing a files array directly with id/original_path, or (B) using dataset_id/data_id for simplified retrieval. It specifies that parameters should come from search/data results, providing clear guidance on when to use each pattern.

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/kkawailab/kklab-mlit-dpf-mcp'

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