Skip to main content
Glama
smith-nathanh

Oracle MCP Server

list_views

Retrieve all database views to understand data structures. Filter by schema owner to focus on specific data sets.

Instructions

List all views in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerNoFilter by schema owner (optional)

Implementation Reference

  • MCP tool call handler branch for 'list_views': extracts optional 'owner' parameter from arguments, calls DatabaseInspector.get_views(owner), formats the views list as JSON, and returns as TextContent.
    elif name == "list_views":
        owner = arguments.get("owner")
        views = await self.inspector.get_views(owner)
    
        return [
            TextContent(
                type="text",
                text=json.dumps({"views": views}, indent=2, default=str),
            )
        ]
  • Core helper method in DatabaseInspector class that executes SQL query against ALL_VIEWS and ALL_TAB_COMMENTS to retrieve views filtered by optional owner, including owner, view_name, and view_comment.
    async def get_views(self, owner: Optional[str] = None) -> List[Dict[str, Any]]:
        """Get list of views"""
        conn = await self.connection_manager.get_connection()
        try:
            cursor = conn.cursor()
    
            query = """
                SELECT 
                    v.owner,
                    v.view_name,
                    vc.comments as view_comment
                FROM all_views v
                LEFT JOIN all_tab_comments vc ON v.owner = vc.owner AND v.view_name = vc.table_name
                WHERE 1=1
            """
    
            params = []
    
            if owner:
                query += " AND v.owner = :owner"
                params.append(owner)
    
            query += " ORDER BY v.owner, v.view_name"
    
            cursor.execute(query, params)
    
            views = []
            for row in cursor:
                views.append(
                    {"owner": row[0], "view_name": row[1], "view_comment": row[2]}
                )
    
            return views
    
        finally:
            conn.close()
  • Registers the 'list_views' tool with the MCP server in handle_list_tools(), specifying name, description, and input schema with optional 'owner' parameter.
    Tool(
        name="list_views",
        description="List all views in the database",
        inputSchema={
            "type": "object",
            "properties": {
                "owner": {
                    "type": "string",
                    "description": "Filter by schema owner (optional)",
                    "default": None,
                }
            },
        },
    ),
  • Pydantic/MCP input schema for 'list_views' tool: object with optional 'owner' string property for filtering views by schema.
    inputSchema={
        "type": "object",
        "properties": {
            "owner": {
                "type": "string",
                "description": "Filter by schema owner (optional)",
                "default": None,
            }
        },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read operation but doesn't specify permissions required, pagination behavior, rate limits, or what 'views' entail in this context. This leaves significant gaps for an agent to understand how to interact with it effectively.

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 a single, direct sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core action without unnecessary elaboration.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is insufficiently complete. It doesn't address behavioral aspects like return format, error handling, or system constraints, which are critical for a tool with no structured metadata to compensate.

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

Parameters3/5

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

The schema description coverage is 100%, so the input schema already documents the optional 'owner' parameter. The description adds no additional parameter semantics beyond what's in the schema, such as format examples or usage tips, resulting in the baseline score for high schema coverage.

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 verb ('List') and resource ('all views in the database'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_tables' or 'list_procedures' beyond the resource type, which prevents a perfect score.

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 like 'list_tables' or 'list_procedures', nor does it mention prerequisites or context for usage. It simply states what the tool does without indicating appropriate scenarios.

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/smith-nathanh/oracle-mcp-server'

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