Skip to main content
Glama
blitzstermayank

Teradata MCP Server

sec_userRoles

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

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

  • Handler function for the 'sec_userRoles' tool. It queries the Teradata system views DBC.RoleInfoV and DBC.RoleMembersV to fetch roles assigned to a given user, formats the results, and returns them 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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the return type as 'formatted response with query results + metadata,' which adds some context beyond the basic purpose. However, it fails to describe critical traits such as whether this is a read-only operation, authentication requirements, rate limits, or error handling, leaving significant gaps for a security-related tool.

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 well-structured and front-loaded, starting with the core purpose followed by arguments and returns in a clear format. It uses minimal sentences without redundancy, making it efficient. However, the 'Returns' section could be more concise by integrating with the purpose statement, slightly reducing its score.

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 moderate complexity (security-related user role retrieval), no annotations, no output schema, and low schema coverage, the description is partially complete. It covers the purpose and parameter but lacks behavioral details, usage guidelines, and output specifics. This is adequate for basic understanding but has clear gaps for effective agent use.

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 description includes an 'Arguments' section that documents the 'user_name' parameter, adding meaning beyond the input schema, which has 0% description coverage. However, it only covers the single parameter without details on format, constraints, or examples. With one parameter and partial documentation, this meets the baseline for adequate but incomplete 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 tool's purpose with 'Get roles assigned to a user,' specifying the verb 'Get' and resource 'roles assigned to a user.' It distinguishes from siblings like 'sec_rolePermissions' and 'sec_userDbPermissions' by focusing on user roles rather than role permissions or database permissions. However, it doesn't explicitly differentiate from all siblings, such as general user analysis tools, keeping it at 4 instead of 5.

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 lacks context on prerequisites, exclusions, or comparisons with sibling tools like 'sec_rolePermissions' or 'sec_userDbPermissions,' which handle related security aspects. Without explicit usage instructions, the agent must infer based on tool names alone.

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/blitzstermayank/MCP'

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