Skip to main content
Glama
kkawailab

MLIT Data Platform MCP Server

by kkawailab

get_thumbnail_urls

Retrieve thumbnail image URLs for MLIT Data Platform datasets and files, with download links expiring in 60 seconds for certain domains.

Instructions

データのサムネイル画像URLを取得する。取得したURLがhttps://www.mlit-data.jp/download/で始まる場合、URLの有効期限は60秒。

            使い方:
            - 基本: dataset_id と data_id を指定して、そのデータに紐づくサムネイルURL一覧を取得します。
            - ファイル個別のサムネイルが欲しい場合は、search/data 結果から取得した file の id を使って絞り込みます(GraphQLの fileID に相当)。
            - 本ツールは2通りに対応:
            (A) thumbnails=[{id, original_path}, ...] を直接渡す(既にファイル情報を持っている場合に高速)
            (B) dataset_id と data_id を渡す(ツール側で対象データのサムネイルを探索)

            例:
            - データIDからサムネイルのURL一覧を取得:
            dataset_id="ndm", data_id="<searchで取得したid>"

            - 特定ファイルのサムネイルを取得(直接指定):
            thumbnails=[{ id:"<fileのid>", original_path:"<元ファイルの相対パス>" }]

            注意:
            - 取得したURLが download ドメインで始まる場合は **60秒以内にダウンロード開始**が必要です(期限切れに注意)。
            - サムネイルが存在しないデータは **空配列** が返ります。
            - fileID を指定しない場合はデータに紐づく代表サムネイル等が返ります。必要に応じてファイルIDで絞り込んでください。
            - レスポンスは配列で、各要素は fileName / URL を含みます(GraphQL: thumbnailURLs)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thumbnailsNo取得するサムネイルの配列
dataset_idNoデータセットID
data_idNoデータID

Implementation Reference

  • The handler for get_thumbnail_urls calls MLITClient.thumbnail_urls or thumbnail_urls_from_data depending on if thumbnails were provided.
    elif name == "get_thumbnail_urls":
        p = ThumbnailURLsInput.model_validate(arguments)
        if p.thumbnails:
            thumbs = [ThumbnailRef(id=t.id, original_path=t.original_path) for t in p.thumbnails]
            data = await client.thumbnail_urls(thumbnails=thumbs)
        else:
            data = await client.thumbnail_urls_from_data(
                dataset_id=str(p.dataset_id), data_id=str(p.data_id)  # type: ignore
            )
  • MLITClient implementation for getting thumbnail URLs via the thumbnail_urls method.
    async def thumbnail_urls(self, *, thumbnails: List[ThumbnailRef]) -> Dict[str, Any]:
        if not thumbnails:
            return {"thumbnailURLs": []}
        q = self.build_thumbnail_urls(thumbnails=thumbnails)
        return await self.post_query(q)
    
    async def thumbnail_urls_from_data(self, *, dataset_id: str, data_id: str) -> Dict[str, Any]:
        thumbs = await self.get_data_thumbnails(dataset_id=dataset_id, data_id=data_id)
        if not thumbs:
            return {"thumbnailURLs": []}
        return await self.thumbnail_urls(thumbnails=thumbs)
  • Registration of get_thumbnail_urls tool including its schema.
        name="get_thumbnail_urls",
        description="""データのサムネイル画像URLを取得する。取得したURLがhttps://www.mlit-data.jp/download/で始まる場合、URLの有効期限は60秒。
    
            使い方:
            - 基本: dataset_id と data_id を指定して、そのデータに紐づくサムネイルURL一覧を取得します。
            - ファイル個別のサムネイルが欲しい場合は、search/data 結果から取得した file の id を使って絞り込みます(GraphQLの fileID に相当)。
            - 本ツールは2通りに対応:
            (A) thumbnails=[{id, original_path}, ...] を直接渡す(既にファイル情報を持っている場合に高速)
            (B) dataset_id と data_id を渡す(ツール側で対象データのサムネイルを探索)
    
            例:
            - データIDからサムネイルのURL一覧を取得:
            dataset_id="ndm", data_id="<searchで取得したid>"
    
            - 特定ファイルのサムネイルを取得(直接指定):
            thumbnails=[{ id:"<fileのid>", original_path:"<元ファイルの相対パス>" }]
    
            注意:
            - 取得したURLが download ドメインで始まる場合は **60秒以内にダウンロード開始**が必要です(期限切れに注意)。
            - サムネイルが存在しないデータは **空配列** が返ります。
            - fileID を指定しない場合はデータに紐づく代表サムネイル等が返ります。必要に応じてファイルIDで絞り込んでください。
            - レスポンスは配列で、各要素は fileName / URL を含みます(GraphQL: thumbnailURLs)。""",
        inputSchema={
            "type": "object",
            "properties": {
                "thumbnails": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "description": "サムネイルID"
                            },
                            "original_path": {
                                "type": "string",
                                "description": "元のファイルパス"
                            }
                        },
                        "required": ["id", "original_path"]
                    },
                    "description": "取得するサムネイルの配列"
                },
                "dataset_id": {
                    "type": "string",
                    "description": "データセットID"
                },
                "data_id": {
                    "type": "string",
                    "description": "データID"
                },
            },
        },
    ),
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses critical 60-second URL expiration for download domain URLs, empty array behavior when thumbnails don't exist, and response structure (array with fileName/URL). Does not mention rate limits or caching behavior, but covers the essential operational constraints.

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?

Well-structured with clear sections: purpose → usage patterns → examples → warnings. Despite length, every section provides distinct value (examples show concrete syntax, notes contain critical 60-second expiration warning). Front-loaded purpose statement followed by progressive detail.

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

Completeness5/5

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

No output schema provided, but description compensates fully by detailing response format ('配列で、各要素は fileName / URL を含みます'), edge case behavior (empty array return), and temporal constraints (60s expiration). Complete coverage for a tool with dual invocation modes and no annotations.

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

Parameters4/5

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

Schema has 100% coverage (baseline 3). Description adds crucial semantic context: explains the mutually exclusive usage modes (direct thumbnails array for 'fast' path vs dataset lookup), clarifies that 'id' corresponds to GraphQL fileID from search results, and documents the relationship between dataset_id and data_id parameters.

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?

Opening sentence 'データのサムネイル画像URLを取得する' provides specific verb (取得する) + resource (サムネイル画像URL). Clearly distinguishes from sibling get_file_download_urls by focusing specifically on thumbnail images rather than file downloads.

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

Usage Guidelines4/5

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

Explicit '使い方' section documents two distinct invocation patterns (A: direct thumbnails array vs B: dataset_id/data_id lookup). Explains when to use file-level filtering ('ファイル個別のサムネイルが欲しい場合') and references integration with search/data results. Lacks explicit comparison to sibling alternatives like get_file_download_urls.

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