Skip to main content
Glama
qiniu

Qiniu MCP Server

Official
by qiniu

live_streaming_create_stream

Create a new live streaming channel using S3-style API for broadcasting video content to audiences.

Instructions

Create a new stream in LiveStreaming using S3-style API. The stream will be created at https://.<endpoint_url>/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketYesLiveStreaming bucket name
streamYesLiveStreaming stream name

Implementation Reference

  • MCP tool handler for 'live_streaming_create_stream': decorated function that validates input via schema and delegates to LiveStreamingService.create_stream, returning result as TextContent.
    @tools.tool_meta(
        types.Tool(
            name="live_streaming_create_stream",
            description="Create a new stream in LiveStreaming using S3-style API. The stream will be created at https://<bucket>.<endpoint_url>/<stream>",
            inputSchema={
                "type": "object",
                "properties": {
                    "bucket": {
                        "type": "string",
                        "description": _BUCKET_DESC,
                    },
                    "stream": {
                        "type": "string",
                        "description": _STREAM_DESC,
                    },
                },
                "required": ["bucket", "stream"],
            },
        )
    )
    async def create_stream(self, **kwargs) -> list[types.TextContent]:
        result = await self.live_streaming.create_stream(**kwargs)
        return [types.TextContent(type="text", text=str(result))]
  • Input schema definition for the live_streaming_create_stream tool, specifying bucket and stream names as required strings.
    types.Tool(
        name="live_streaming_create_stream",
        description="Create a new stream in LiveStreaming using S3-style API. The stream will be created at https://<bucket>.<endpoint_url>/<stream>",
        inputSchema={
            "type": "object",
            "properties": {
                "bucket": {
                    "type": "string",
                    "description": _BUCKET_DESC,
                },
                "stream": {
                    "type": "string",
                    "description": _STREAM_DESC,
                },
            },
            "required": ["bucket", "stream"],
        },
    )
  • Top-level registration entrypoint: creates LiveStreamingService instance and calls register_tools to auto-register all live streaming tools including live_streaming_create_stream.
    def load(cfg: config.Config):
        live = LiveStreamingService(cfg)
        register_tools(live)
  • Registers the tool handler instance by calling tools.auto_register_tools on the list including create_stream.
    def register_tools(live_streaming: LiveStreamingService):
        tool_impl = _ToolImpl(live_streaming)
        tools.auto_register_tools(
            [
                tool_impl.create_bucket,
                tool_impl.create_stream,
                tool_impl.bind_push_domain,
                tool_impl.bind_play_domain,
                tool_impl.get_push_urls,
                tool_impl.get_play_urls,
                tool_impl.query_live_traffic_stats,
                tool_impl.list_buckets,
                tool_impl.list_streams,
            ]
        )
  • Underlying service method that performs the actual HTTP PUT request to create the stream at the LiveStreaming S3-style endpoint with authentication.
    async def create_stream(self, bucket: str, stream: str) -> Dict[str, Any]:
        """
        Create a stream using S3-style API
    
        Args:
            bucket: The bucket name
            stream: The stream name to create
    
        Returns:
            Dict containing the response status and message
        """
        url = self._build_stream_url(bucket, stream)
        data = {}
        bodyJson = json.dumps(data)
        headers = {
            **self._get_auth_header(method="PUT", url=url, content_type="application/json", body=bodyJson),
            "Content-Type": "application/json"
        }
    
        logger.info(f"Creating stream: {stream} in bucket: {bucket} at {url}")
    
        async with aiohttp.ClientSession() as session:
            async with session.put(url, headers=headers, data=bodyJson) as response:
                status = response.status
                text = await response.text()
    
                if status == 200 or status == 201:
                    logger.info(f"Successfully created stream: {stream} in bucket: {bucket}")
                    return {
                        "status": "success",
                        "bucket": bucket,
                        "stream": stream,
                        "url": url,
                        "message": f"Stream '{stream}' created successfully in bucket '{bucket}'",
                        "status_code": status
                    }
                else:
                    logger.error(f"Failed to create stream: {stream}, status: {status}, response: {text}")
                    return {
                        "status": "error",
                        "bucket": bucket,
                        "stream": stream,
                        "url": url,
                        "message": f"Failed to create stream: {text}",
                        "status_code": status
                    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the creation action and resulting URL pattern but doesn't disclose permission requirements, whether the operation is idempotent, error conditions, rate limits, or what happens if the stream already exists. 'Create' implies mutation but lacks safety context.

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?

Two concise sentences with zero waste. The first sentence states the core purpose, the second provides useful implementation detail about the resulting URL structure. However, it could be more front-loaded with critical behavioral information given the lack of annotations.

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?

For a creation/mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what 'create' entails operationally, what permissions are needed, what the response contains, or error handling. The URL format hint is helpful but insufficient for safe agent invocation.

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?

Schema description coverage is 100%, so the schema already documents both parameters fully. The description adds marginal value by showing how parameters combine in the resulting URL ('https://<bucket>.<endpoint_url>/<stream>'), but doesn't provide additional semantics beyond what the schema descriptions ('LiveStreaming bucket name', 'LiveStreaming stream name') already convey.

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 action ('Create a new stream') and resource ('in LiveStreaming'), with specific technology context ('using S3-style API'). It distinguishes from siblings like 'live_streaming_list_streams' (list vs create) and 'live_streaming_create_bucket' (bucket vs stream), but doesn't explicitly differentiate from other creation tools.

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. The description mentions the resulting URL format but doesn't specify prerequisites (e.g., bucket must exist), use cases, or when to choose this over other streaming tools like 'live_streaming_bind_play_domain'.

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

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