Skip to main content
Glama
susheel

Synapse MCP Server

get_entity

Retrieve Synapse entities like datasets, projects, folders, files, or tables by their unique ID to access metadata and annotations programmatically.

Instructions

Get a Synapse entity by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the core logic of the get_entity tool: input validation, retrieves entity operations from context state, and calls get_entity_by_id on the base operations.
    def get_entity(entity_id: str, ctx: Context) -> Dict[str, Any]:
        """Return Synapse entity metadata by ID (projects, folders, files, tables, etc.)."""
        if not validate_synapse_id(entity_id):
            return {"error": f"Invalid Synapse ID: {entity_id}"}
    
        try:
            entity_ops = get_entity_operations(ctx)
            return entity_ops["base"].get_entity_by_id(entity_id)
        except ConnectionAuthError as exc:
            return {"error": f"Authentication required: {exc}", "entity_id": entity_id}
        except Exception as exc:  # pragma: no cover - defensive path
            return {"error": str(exc), "entity_id": entity_id}
  • The @mcp.tool decorator registers the 'get_entity' function as an MCP tool, defining its title, description, and operational hints.
    @mcp.tool(
        title="Fetch Entity",
        description="Return Synapse entity metadata by ID (projects, folders, files, tables, etc.). Only retrieves metadata information - does not download file content.",
        annotations={
            "readOnlyHint": True,
            "idempotentHint": True,
            "destructiveHint": False,
            "openWorldHint": True,
        },
    )
  • Implements the low-level retrieval of Synapse entity metadata using the Synapse client, called by the tool handler.
    def get_entity_by_id(self, entity_id: str) -> Dict[str, Any]:
        """Get an entity by ID.
    
        Args:
            entity_id: The Synapse ID of the entity
    
        Returns:
            The entity as a dictionary
        """
        # IMPORTANT: Always keep downloadFile=False to avoid downloading file content
        # when fetching entity metadata. This prevents unnecessary downloads and
        # keeps the operation lightweight for metadata-only operations.
        entity = self.synapse_client.get(entity_id, downloadFile=False)
        return self.format_entity(entity)
  • Factory function that retrieves or lazily initializes per-connection entity operations (including base operations) from the MCP context state.
    def get_entity_operations(ctx: Context) -> Dict[str, Any]:
        """Get entity operations for this connection's synapseclient."""
        synapse_client = get_synapse_client(ctx)
    
        entity_ops = ctx.get_state("entity_ops")
        if entity_ops:
            return entity_ops
    
        entity_ops = {
            "base": BaseEntityOperations(synapse_client),
            "project": ProjectOperations(synapse_client),
            "folder": FolderOperations(synapse_client),
            "file": FileOperations(synapse_client),
            "table": TableOperations(synapse_client),
            "dataset": DatasetOperations(synapse_client),
        }
    
        ctx.set_state("entity_ops", entity_ops)
        return entity_ops
Behavior2/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 of behavioral disclosure. It states the tool 'Get[s]' an entity, implying a read operation, but doesn't specify whether it's safe, requires authentication, has rate limits, or what happens if the ID is invalid. For a tool with zero annotation coverage, this leaves critical behavioral traits undisclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—a single sentence with no wasted words. It's front-loaded with the core purpose, making it easy to parse. Every word earns its place, and there's no redundancy or unnecessary elaboration.

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 (one parameter) and the presence of an output schema (which handles return values), the description is minimally complete. However, it lacks context about Synapse entities and doesn't differentiate from siblings, leaving gaps in understanding when and how to use it effectively. It's adequate but with clear room for improvement.

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?

The description adds meaning by specifying that the 'entity_id' parameter is used to retrieve a Synapse entity, which clarifies the parameter's purpose beyond the schema's basic 'Entity Id' title. With 0% schema description coverage and only one parameter, this minimal addition is sufficient to compensate, earning a baseline 4 for adequate coverage in this simple case.

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

Purpose3/5

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

The description states the tool's purpose ('Get a Synapse entity by ID'), which is clear but vague. It specifies the verb 'Get' and resource 'Synapse entity', but doesn't explain what a Synapse entity is or distinguish it from sibling tools like 'get_entity_children' or 'get_entity_annotations'. The purpose is understandable but lacks specificity.

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. With siblings like 'query_entities', 'search_entities', and 'get_entity_children', it's unclear whether this is for retrieving a single entity by exact ID versus other lookup methods. No context, exclusions, or prerequisites are mentioned.

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/susheel/synapse-mcp'

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