Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

sec_userDbPermissions

Retrieve and display database permissions for a specific Teradata user to analyze access rights and security settings.

Instructions

Get permissions for a user.

Arguments: user_name - user name to analyze

Returns: ResponseType: formatted response with query results + metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_nameYes

Implementation Reference

  • The core handler function implementing the sec_userDbPermissions tool. It takes a TeradataConnection and user_name, queries DBC.AllRightsV for the user's permissions on databases/tables/columns, formats the results, and returns a structured response with metadata.
    def handle_sec_userDbPermissions(conn: TeradataConnection, user_name: str, *args, **kwargs):
        """
        Get permissions for a user.
    
        Arguments:
          user_name - user name to analyze
    
        Returns:
          ResponseType: formatted response with query results + metadata
        """
        logger.debug(f"Tool: handle_sec_userDbPermissions: Args: user_name: {user_name}")
    
        with conn.cursor() as cur:
            if user_name == "":
                logger.debug("No user_name argument provided")
                data = rows_to_json(None, [])
            else:
                logger.debug(f"Argument provided: {user_name}")
                rows = cur.execute(f"""
                    SELECT
                        DatabaseName,
                        TableName,
                        ColumnName,
                        AccessRight,
                        GrantAuthority,
                        GrantorName
                    FROM DBC.AllRightsV
                    WHERE UserName = '{user_name}'
                    ORDER BY DatabaseName, TableName, AccessRight;""")
                data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "sec_userDbPermissions",
                "argument": user_name,
                "num_permissions": len(data)
            }
            logger.debug(f"Tool: handle_sec_userDbPermissions: metadata: {metadata}")
            return create_response(data, metadata)
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 states this is a read operation ('Get'), which implies it's non-destructive, but doesn't mention any behavioral traits like authentication requirements, rate limits, or what specific permissions are returned (e.g., database, table-level). The mention of 'formatted response with query results + metadata' adds some context but is vague.

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 ('Get permissions for a user.'), followed by brief sections for arguments and returns. There's minimal waste, though the 'Returns' section could be more specific about the metadata included.

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 tool's complexity (security-related query), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what types of permissions are retrieved (e.g., database roles, table access), how results are formatted, or potential errors. For a tool in a security context with siblings, more detail is needed to ensure proper usage.

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 0%, so the description must compensate. It adds meaning by explaining that 'user_name' is 'user name to analyze', which clarifies the parameter's purpose beyond the schema's generic 'User Name' title. However, it doesn't provide details on format, constraints, or examples, leaving gaps for a tool with 1 parameter.

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 with a specific verb ('Get') and resource ('permissions for a user'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'sec_rolePermissions' or 'sec_userRoles', which likely handle related but distinct security aspects.

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. There are multiple sibling tools in the 'sec_' category (e.g., 'sec_rolePermissions', 'sec_userRoles') that likely handle related security queries, but the description doesn't mention any context, prerequisites, or comparisons to help an agent choose appropriately.

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/Teradata/teradata-mcp-server'

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