Skip to main content
Glama
jikime

YouTube Toolbox

get_channel_details

Retrieve comprehensive YouTube channel data including statistics, metadata, and content details to analyze performance and gather insights.

Instructions

Get detailed information about a YouTube channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler function that executes the get_channel_details tool logic by calling the YouTubeService helper, formatting the API response, and handling errors.
    @mcp.tool(
        name="get_channel_details",
        description="Get detailed information about a YouTube channel",
    )
    async def get_channel_details(channel_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a YouTube channel
        
        Args:
            channel_id (str): YouTube channel ID
        
        Returns:
            Dict[str, Any]: Channel details
        """
        try:
            channel_data = youtube_service.get_channel_details(channel_id)
            
            if not channel_data.get('items'):
                return {'error': f"Channel with ID {channel_id} not found"}
                
            channel = channel_data['items'][0]
            
            # Format the response
            details = {
                'id': channel.get('id'),
                'title': channel.get('snippet', {}).get('title'),
                'description': channel.get('snippet', {}).get('description'),
                'publishedAt': channel.get('snippet', {}).get('publishedAt'),
                'customUrl': channel.get('snippet', {}).get('customUrl'),
                'thumbnails': channel.get('snippet', {}).get('thumbnails'),
                'subscriberCount': channel.get('statistics', {}).get('subscriberCount'),
                'videoCount': channel.get('statistics', {}).get('videoCount'),
                'viewCount': channel.get('statistics', {}).get('viewCount'),
                'url': f"https://www.youtube.com/channel/{channel_id}"
            }
            
            return details
        except Exception as e:
            logger.exception(f"Error in get_channel_details: {e}")
            return {'error': str(e)}
  • Supporting utility method in YouTubeService class that performs the actual YouTube Data API v3 call to fetch channel details using channels.list endpoint.
    def get_channel_details(self, channel_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific YouTube channel
        """
        channel_id = self.parse_url(channel_id)
        
        try:
            response = self.youtube.channels().list(
                part='snippet,statistics',
                id=channel_id
            ).execute()
            return response
        except HttpError as e:
            logger.error(f"Error getting channel details: {e}")
            raise e
  • server.py:1012-1014 (registration)
    The @mcp.tool decorator that registers the get_channel_details tool with name and description.
    @mcp.tool(
        name="get_channel_details",
        description="Get detailed information about a YouTube channel",
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 the tool retrieves 'detailed information' but doesn't specify what details are included (e.g., subscriber count, videos, metadata), whether it's a read-only operation, rate limits, authentication needs, or error handling. This leaves significant gaps in understanding the tool's behavior.

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, clear sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple tool, making it easy to parse quickly without unnecessary elaboration.

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 low complexity (1 parameter, no nested objects) and the presence of an output schema (which should define return values), the description is minimally adequate. However, with no annotations and low schema coverage, it lacks context on behavior and parameters that could help the agent use it effectively, leaving room for improvement.

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 1 parameter with 0% description coverage, so the schema provides no semantic context. The description doesn't add any parameter-specific information beyond implying a 'channel_id' is needed. It doesn't explain what a channel ID is, where to find it, or format requirements, resulting in minimal value beyond the bare schema.

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 'Get' and resource 'detailed information about a YouTube channel', making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'get_video_details' or 'get_video_enhanced_transcript', which also retrieve YouTube content information, so it doesn't fully distinguish its specific scope.

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 doesn't mention sibling tools like 'get_video_details' for video-specific data or 'search_videos' for broader searches, leaving the agent without context for tool selection. There's no indication of prerequisites or typical use cases.

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/jikime/py-mcp-youtube-toolbox'

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