Skip to main content
Glama
JussCubs

mcp-server-test

by JussCubs

fetch_profile

Retrieve detailed profile data for a Vector trader by providing their username. Get a JSON string containing trader profile information.

Instructions

Fetch detailed profile data for a Vector trader

Args:
    username: Vector username to fetch
    
Returns:
    JSON string with profile data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for the fetch_profile tool. Takes a username, builds a GraphQL payload using PROFILE_QUERY, posts it to the Vector API, and returns the JSON response.
    @mcp.tool(name="fetch_profile")
    async def fetch_profile(
        username: str,
        ctx: Context = None
    ) -> str:
        """Fetch detailed profile data for a Vector trader
        
        Args:
            username: Vector username to fetch
            
        Returns:
            JSON string with profile data
        """
        if ctx:
            ctx.info(f"Fetching profile data for {username}...")
        
        # Hardcoded variables as requested
        variables = {
            "username": username,
            "cursor": None,
            "count": 10
        }
        
        payload = {
            "query": PROFILE_QUERY,
            "variables": variables
        }
        
        async with httpx.AsyncClient(verify=False) as client:
            try:
                response = await client.post(
                    API_URL, 
                    json=payload, 
                    headers=HEADERS
                )
                response.raise_for_status()
                return response.text
            except Exception as e:
                error_message = f"Error fetching profile data: {str(e)}"
                if ctx:
                    ctx.error(error_message)
                return error_message
  • GraphQL query used by fetch_profile. Fetches profile info, holdings, and recent broadcasts for a given username.
    PROFILE_QUERY = """
    query UsernameProfileQuery(
      $username: String!
      $cursor: String
      $count: Int
    ) {
      profile(username: $username, refcode: $username) {
        id
        username
        moderationState
        twitterUsername
        followerCountX
        followerCount
        weeklyLeaderboardStanding(leaderboardType: PNL_WIN) {
          rank
          value
        }
        profileLeaderboardValues {
          daily {
            pnl
            volume
            maxTradeSize
          }
          weekly {
            pnl
            volume
            maxTradeSize
          }
        }
      }
      userHoldings(id: $username, after: $cursor, first: $count) {
        edges {
          cursor
          node {
            portfolioPercentage
            token {
              id
              address
              chain
              name
              symbol
              image
            }
          }
        }
        pageInfo {
          hasNextPage
          endCursor
        }
      }
      userBroadcastsV2(id: $username, after: $cursor, first: $count) {
        edges {
          cursor
          node {
            broadcast {
              id
              message
              createdAt
              buyTokenId
              buyTokenAmount
              buyPositionSize
              buyTokenPrice: buyTokenPriceV2
              sellTokenId
              sellTokenAmount
              sellPositionSize
              sellTokenPrice: sellTokenPriceV2
              broadcastCandleChart {
                cycleStats {
                  pnl
                  totalBought
                  totalHeld
                  totalSold
                }
              }
            }
            buyToken {
              id
              chain
              name
              symbol
              price
              image
              address
            }
            sellToken {
              id
              chain
              name
              symbol
              price
              image
              address
            }
          }
        }
        pageInfo {
          endCursor
          hasNextPage
        }
      }
    }
    """
  • Registration of the fetch_profile tool using the @mcp.tool decorator.
    @mcp.tool(name="fetch_profile")
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only indicates a read operation (fetch) and returns JSON string, but lacks information on authentication, rate limits, error handling, or whether the action is safe.

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 short and front-loaded with the purpose. It uses a standard docstring format with Args/Returns, which is efficient, though it could integrate the parameter hint into the main sentence.

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?

The description covers the single parameter and states the return type (JSON string with profile data). However, it does not detail the output structure or any edge cases, which would be helpful given the output schema exists.

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 input schema has 0% description coverage, so the description compensates by stating that 'username' is a 'Vector username'. This adds meaning beyond the schema's 'string' type, but does not specify format or constraints.

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

Purpose5/5

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

The description clearly states it fetches detailed profile data for a Vector trader, specifying the resource and action. It is distinct from sibling tools (fetch_leaderboard, fetch_token_broadcasts, fetch_token_data) as it focuses on user profiles.

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?

No guidance on when to use this tool versus alternatives or when not to use it. The description does not mention any prerequisites or context such as requiring the trader to exist.

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/JussCubs/mcp-server-test'

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