Skip to main content
Glama
Alex-Smith-1234

讯飞智文PPT生成服务MCP Server

create_outline_by_doc

Generate PowerPoint outlines from documents to structure presentation content. Upload PDF, DOC, DOCX, TXT, or MD files to create organized outlines for PPT generation.

Instructions

从文档创建PPT大纲。

使用说明:
1. 用于根据文档内容生成PPT大纲。
2. 支持通过file_url或file_path上传文档。
3. 文档格式支持:pdf(不支持扫描件)、doc、docx、txt、md。
4. 文档大小限制:10M以内,字数限制8000字以内。
5. 生成的大纲可用于create_ppt_by_outline工具。
6. 需先设置环境变量AIPPT_APP_ID和AIPPT_API_SECRET。

参数:
- file_name: 文档文件名,必须包含文件后缀名。
- file_url: 文档文件的URL地址,与file_path二选一必填。
- file_path: 文档文件的本地路径,与file_url二选一必填。
- text: 补充的文本内容,用于指导大纲生成。
- language: 大纲生成的语言,目前支持cn(中文)。
- search: 是否联网搜索,True表示联网搜索补充内容,False表示不联网。

返回:
包含生成的大纲内容的字典。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_nameYes
textYes
file_urlNo
file_pathNo
languageNocn
searchNo

Implementation Reference

  • The handler function for the 'create_outline_by_doc' tool. It constructs a multipart form data request to the xfyun API endpoint to generate a PPT outline from a provided document (via URL or local path), with optional text guidance, language, and search settings. The @mcp.tool() decorator registers it as an MCP tool, and parameters define the input schema.
    @mcp.tool()
    def create_outline_by_doc(
        ctx: Context,
        file_name: str,
        text: str,
        file_url: Optional[str] = None,
        file_path: Optional[str] = None,
        language: str = "cn",
        search: bool = False
    ) -> Dict[str, Any]:
        """
        从文档创建PPT大纲。
        
        使用说明:
        1. 用于根据文档内容生成PPT大纲。
        2. 支持通过file_url或file_path上传文档。
        3. 文档格式支持:pdf(不支持扫描件)、doc、docx、txt、md。
        4. 文档大小限制:10M以内,字数限制8000字以内。
        5. 生成的大纲可用于create_ppt_by_outline工具。
        6. 需先设置环境变量AIPPT_APP_ID和AIPPT_API_SECRET。
        
        参数:
        - file_name: 文档文件名,必须包含文件后缀名。
        - file_url: 文档文件的URL地址,与file_path二选一必填。
        - file_path: 文档文件的本地路径,与file_url二选一必填。
        - text: 补充的文本内容,用于指导大纲生成。
        - language: 大纲生成的语言,目前支持cn(中文)。
        - search: 是否联网搜索,True表示联网搜索补充内容,False表示不联网。
        
        返回:
        包含生成的大纲内容的字典。
        """
        url = "https://zwapi.xfyun.cn/api/ppt/v2/createOutlineByDoc"
        fields = {
            "fileName": file_name,
            "query": text,
            "language": language,
            "search": str(search)
        }
        if file_url:
            fields["fileUrl"] = file_url
        elif file_path:
            fields["file"] = (file_name, open(file_path, 'rb'), 'text/plain')
        form_data = MultipartEncoder(fields=fields)
        headers = get_headers(form_data.content_type)
        response = requests.post(url, data=form_data, headers=headers)
    
        if response.status_code != 200:
            raise Exception(f"调用失败: {response.text}")
        
        return response.text
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well: it discloses document format support (pdf, doc, docx, txt, md with exclusions like scanned PDFs), size/word limits (10M, 8000 words), authentication requirements (environment variables), and integration with another tool (create_ppt_by_outline). It doesn't mention rate limits or error handling, but covers key behavioral aspects.

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 well-structured and front-loaded: it starts with the core purpose, then lists usage instructions in numbered points, followed by parameters and return value sections. Every sentence adds value—no fluff or repetition. It's appropriately sized for a tool with 6 parameters and complex behavior.

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

Completeness4/5

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

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is largely complete: it covers purpose, usage, behavioral traits, and parameter semantics. The main gap is the lack of output details—it only states '包含生成的大纲内容的字典' without specifying structure or examples. However, it compensates well with other context.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It adds significant meaning: explains file_url vs file_path as mutually exclusive options, clarifies file_name must include extension, describes text as supplementary guidance, specifies language support (cn), and explains search parameter for online content. It doesn't detail default values or all constraints, but provides substantial context beyond the bare schema.

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 the tool's purpose: '从文档创建PPT大纲' (create PPT outline from document). It specifies the action (create outline), the resource (document), and distinguishes it from sibling tools like create_outline (which likely doesn't use documents) and create_ppt_by_outline (which uses outlines to create PPTs).

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 explicit usage guidelines: it states when to use ('用于根据文档内容生成PPT大纲'), mentions a sibling tool alternative ('生成的大纲可用于create_ppt_by_outline工具'), and includes prerequisites ('需先设置环境变量AIPPT_APP_ID和AIPPT_API_SECRET'). It also specifies document format and size limits, which help determine when not to use it.

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