Skip to main content
Glama
Alex-Smith-1234

讯飞智文PPT生成服务MCP Server

create_ppt_by_outline

Convert structured outlines into PowerPoint presentations with customizable templates, automatic image insertion, and speaker notes generation.

Instructions

根据大纲创建PPT。

使用说明:
1. 用于根据已生成的大纲创建PPT。
2. 大纲需通过create_outline或create_outline_by_doc工具生成。
3. template_id需通过get_theme_list工具获取。
4. 工具会返回任务ID(sid),需用get_task_progress轮询查询进度。
5. 任务完成后,可从get_task_progress结果中获取PPT下载地址。
6. 需先设置环境变量AIPPT_APP_ID和AIPPT_API_SECRET。

参数:
- text: PPT生成的内容描述,用于指导PPT生成。
- outline: 大纲内容,需从create_outline或create_outline_by_doc工具返回的JSON响应中提取['data']['outline']字段的值。该字段包含生成的大纲内容,格式为dict。
- template_id: PPT模板ID,需通过get_theme_list工具获取。
- author: PPT作者名称,将显示在生成的PPT中。
- is_card_note: 是否生成PPT演讲备注,True表示生成,False表示不生成。
- search: 是否联网搜索,True表示联网搜索补充内容,False表示不联网。
- is_figure: 是否自动配图,True表示自动配图,False表示不配图。
- ai_image: AI配图类型,仅在is_figure为True时生效。可选值:normal-普通配图(20%正文配图),advanced-高级配图(50%正文配图)。

返回:
成功时返回包含sid的字典,失败时抛出异常。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
outlineYes
template_idYes
authorNoXXXX
is_card_noteNo
searchNo
is_figureNo
ai_imageNonormal

Implementation Reference

  • The @mcp.tool()-decorated handler function implementing the create_ppt_by_outline tool. It constructs a request body from parameters including the outline dict, sends a POST to the xfyun API endpoint, and returns the task sid on success.
    @mcp.tool()
    def create_ppt_by_outline(
        ctx: Context,
        text: str,
        outline: dict,
        template_id: str,
        author: str = "XXXX",
        is_card_note: bool = True,
        search: bool = False,
        is_figure: bool = True,
        ai_image: str = "normal"
    ) -> Dict[str, Any]:
        """
        根据大纲创建PPT。
        
        使用说明:
        1. 用于根据已生成的大纲创建PPT。
        2. 大纲需通过create_outline或create_outline_by_doc工具生成。
        3. template_id需通过get_theme_list工具获取。
        4. 工具会返回任务ID(sid),需用get_task_progress轮询查询进度。
        5. 任务完成后,可从get_task_progress结果中获取PPT下载地址。
        6. 需先设置环境变量AIPPT_APP_ID和AIPPT_API_SECRET。
        
        参数:
        - text: PPT生成的内容描述,用于指导PPT生成。
        - outline: 大纲内容,需从create_outline或create_outline_by_doc工具返回的JSON响应中提取['data']['outline']字段的值。该字段包含生成的大纲内容,格式为dict。
        - template_id: PPT模板ID,需通过get_theme_list工具获取。
        - author: PPT作者名称,将显示在生成的PPT中。
        - is_card_note: 是否生成PPT演讲备注,True表示生成,False表示不生成。
        - search: 是否联网搜索,True表示联网搜索补充内容,False表示不联网。
        - is_figure: 是否自动配图,True表示自动配图,False表示不配图。
        - ai_image: AI配图类型,仅在is_figure为True时生效。可选值:normal-普通配图(20%正文配图),advanced-高级配图(50%正文配图)。
        
        返回:
        成功时返回包含sid的字典,失败时抛出异常。
        """
        url = "https://zwapi.xfyun.cn/api/ppt/v2/createPptByOutline"
        headers = get_headers()
        if isinstance(outline, str):
            outline = json.loads(outline)
        body = {
            "query": text,
            "outline": outline,
            "templateId": template_id,
            "author": author,
            "isCardNote": is_card_note,
            "search": search,
            "isFigure": is_figure,
            "aiImage": ai_image
        }
        response = requests.post(url, json=body, headers=headers)
    
        if response.status_code != 200:
            raise Exception(f"调用失败: {response.text}")
        
        resp = json.loads(response.text)
        if resp['code'] == 0:
            return {"sid": resp['data']['sid']}
        else:
            raise Exception(f"根据大纲创建PPT失败: {response.text}")
Behavior4/5

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

With no annotations provided, the description carries full burden and does an excellent job disclosing behavioral traits. It explains the asynchronous nature (returns task ID for polling), workflow dependencies, authentication requirements, and output format (dictionary with sid). It also clarifies failure behavior (throws exceptions). The only minor gap is lack of rate limit or quota information.

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 with clear sections (purpose, usage instructions, parameters, returns) but could be more concise. Some sentences could be combined (e.g., the multiple tool references in usage guidelines). However, every sentence earns its place by providing essential information, and the structure helps with readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (8 parameters, asynchronous workflow, multiple dependencies) and absence of both annotations and output schema, the description provides complete contextual information. It covers purpose, prerequisites, workflow, parameter semantics, and return behavior. For a complex tool with no structured metadata, this description is comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for 8 parameters, the description fully compensates by providing detailed semantic explanations for every parameter. It clarifies data sources (outline from specific JSON path, template_id from get_theme_list), boolean parameter meanings, dependencies (ai_image only when is_figure is True), and enum values for ai_image. This adds substantial 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 tool's purpose: '根据大纲创建PPT' (create PPT based on outline). It specifies the verb ('创建' - create) and resource ('PPT'), but doesn't explicitly differentiate from sibling 'create_ppt_task' which might have overlapping functionality. The purpose is clear but sibling differentiation is incomplete.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides excellent usage guidelines with explicit prerequisites and workflow context. It specifies when to use (after generating outline via create_outline or create_outline_by_doc), prerequisites (environment variables AIPPT_APP_ID and AIPPT_API_SECRET), and the complete workflow (returns task ID for polling with get_task_progress, then download from results). It also references template_id source from get_theme_list.

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/Alex-Smith-1234/zwppt-mcp'

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