Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

sec_userRoles

Retrieve assigned roles for a specific user in Teradata databases to manage access permissions and security analysis.

Instructions

Get roles assigned to 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 handler function that implements the core logic of the sec_userRoles tool. It executes a SQL query to fetch roles associated with the given user_name from Teradata's system views, processes the results into JSON format using helper utilities, and returns a structured response with metadata including the tool name.
    def handle_sec_userRoles(conn: TeradataConnection, user_name: str, *args, **kwargs):
        """
        Get roles assigned to a user.
    
        Arguments:
          user_name - user name to analyze
    
        Returns:
          ResponseType: formatted response with query results + metadata
        """
        logger.debug(f"Tool: handle_sec_userRoles: 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
                        r.RoleName,
                        r.CreatorName,
                        r.CreateTimeStamp,
                        Rm.Grantor,
                        Rm.WhenGranted,
                        Rm.DefaultRole,
                        Rm.WithAdmin
                    FROM DBC.RoleInfoV r
                    JOIN DBC.RoleMembersV Rm
                    ON r.RoleName = Rm.RoleName
                    WHERE r.RoleName LIKE  '%{user_name}%' (NOT CASESPECIFIC);""")
                data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "sec_userRoles",
                "argument": user_name,
                "num_roles": len(data)
            }
            logger.debug(f"Tool: handle_sec_userRoles: 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. While it states what the tool does ('Get roles assigned to a user'), it doesn't describe important behavioral aspects like whether this requires special permissions, what format the results come in, whether there are rate limits, or what happens with invalid user names. The mention of 'formatted response with query results + metadata' in the Returns section is helpful but minimal.

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 concise with three clear sections (purpose, arguments, returns) in just a few sentences. The structure is logical and front-loaded with the core purpose. While efficient, the 'Returns' section could be slightly more informative about what 'metadata' includes.

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?

For a single-parameter tool with no output schema and no annotations, the description provides the minimum viable information: what it does, what parameter it needs, and a basic sense of what it returns. However, it lacks important context about behavioral aspects, error conditions, and differentiation from similar tools, making it incomplete for confident use by an AI agent.

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 does provide some parameter information by listing 'user_name - user name to analyze' in the Arguments section, which adds meaning beyond the bare schema. However, it doesn't provide format requirements, examples, or constraints for the user_name parameter, leaving significant gaps in understanding how to use it correctly.

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 ('roles assigned to a user'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'sec_rolePermissions' or 'sec_userDbPermissions', which appear related to security/permissions but have different specific functions.

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 several sibling tools with 'sec_' prefixes (sec_rolePermissions, sec_userDbPermissions) that likely handle related security/permissions data, but the description doesn't indicate when this specific user roles tool is appropriate versus those other options.

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