Skip to main content
Glama

get_manifest

Extract and retrieve the AndroidManifest.xml file from a decoded APK project to analyze app permissions, components, and configurations.

Instructions

Get the AndroidManifest.xml content from a decoded APK project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_dirYes

Implementation Reference

  • Handler function for the 'get_manifest' MCP tool. It validates the project directory, locates and reads the AndroidManifest.xml file, and returns its content along with metadata and file information. Includes comprehensive error handling.
    @mcp.tool()
    async def get_manifest(project_dir: str) -> Dict:
        """
        Get the AndroidManifest.xml content from a decoded APK project with validation.
        
        Args:
            project_dir: Path to the APKTool project directory
            
        Returns:
            Dictionary with manifest content, metadata, and validation results
        """
        # Input validation
        path_validation = ValidationUtils.validate_path(project_dir, must_exist=True)
        if not path_validation["valid"]:
            return {"success": False, "error": path_validation["error"]}
        
        manifest_path = os.path.join(project_dir, "AndroidManifest.xml")
        if not os.path.exists(manifest_path):
            return {
                "success": False,
                "error": f"AndroidManifest.xml not found in {project_dir}",
                "expected_path": manifest_path
            }
        
        try:
            with open(manifest_path, 'r', encoding="utf-8") as f:
                content = f.read()
     
            result = {
                "success": True,
                "manifest": content,
                "path": manifest_path,
                "size": os.path.getsize(manifest_path),
                "encoding": "utf-8"
            }
            
            return result
            
        except Exception as e:
            logger.error(f"Error reading manifest: {str(e)}")
            return {
                "success": False,
                "error": f"Failed to read AndroidManifest.xml: {str(e)}",
                "path": manifest_path
            }
Install Server

Other Tools

Related 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/zinja-coder/apktool-mcp-server'

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