Skip to main content
Glama
singlestore-labs

SingleStore MCP Server

check_if_file_exists

Verify the existence of a file (notebook) in the user's shared space. Provides a JSON response indicating file status, including existence and a descriptive message.

Instructions

Check if a file (notebook) exists in the user's shared space.

Args:
    file_name: Name of the file to check (with or without .ipynb extension)

Returns:
    JSON object with the file existence status
    {
        "exists": True/False,
        "message": "File exists" or "File does not exist"
    }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ctxNo
file_nameYes

Implementation Reference

  • The handler function implementing the logic to check if a specified file exists in the user's shared or personal space using the SingleStoreDB file manager SDK.
    def check_if_file_exists(file_name: str, location: str = "shared") -> bool:
        """
        Check if a file exists in the user's shared or personal space.
    
        Args:
            file_name: Name of the file to check (with or without .ipynb extension)
            location: Location to check ("shared" or "personal")
    
        Returns:
            Boolean indicating whether the file exists
        """
        settings = config.get_settings()
        org_id = get_org_id()
        access_token = get_access_token()
    
        file_manager = s2.manage_files(
            access_token=access_token,
            base_url=settings.s2_api_base_url,
            organization_id=org_id,
        )
    
        if location == "shared":
            return file_manager.shared_space.exists(file_name)
        else:  # personal
            try:
                return file_manager.personal_space.exists(file_name)
            except AttributeError:
                # If personal space is not supported, return False
                logger.warning("Personal space not supported by SDK")
                return False
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool checks existence and returns a JSON object with status and message, which is useful. However, it doesn't cover behavioral aspects like error handling, permissions required, rate limits, or whether it's a read-only operation (though 'check' implies non-destructive). The description adds some context but lacks depth for a tool with no annotation support.

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 appropriately sized and front-loaded, with the core purpose stated first, followed by args and returns sections. Every sentence earns its place by providing essential information. It could be slightly more concise by integrating the args/returns into a single paragraph, but overall it's well-structured and efficient.

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

Completeness3/5

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

Given the tool's low complexity (simple existence check), no annotations, and no output schema, the description is moderately complete. It covers the purpose, parameter semantics, and return format, but lacks details on behavioral traits (e.g., error cases, permissions) and usage guidelines relative to siblings. For a basic tool, it's adequate but has clear gaps in contextual information.

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?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains that 'file_name' is the 'Name of the file to check (with or without .ipynb extension)', clarifying the parameter's purpose and format. This compensates fully for the schema's lack of documentation, making the parameter semantics clear and actionable.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Check if a file (notebook) exists in the user's shared space.' It specifies the verb ('check'), resource ('file/notebook'), and scope ('user's shared space'). However, it doesn't explicitly differentiate from sibling tools like 'list_shared_files' or 'get_notebook_path', which might offer related functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_shared_files' (which might list files) or 'get_notebook_path' (which might retrieve paths), nor does it specify prerequisites or exclusions. Usage is implied but not explicitly stated.

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

Related 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/singlestore-labs/mcp-server-singlestore'

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